| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Message
| FWIW this is the current protocol I am using ...
Groups of players
The current player, and his/her group, are sent in one message. This message has the "group" table, so that any number of members can easily be represented (eg. as [1], [2] etc.).
To identify the player for whom the message is being sent, the "me = true" boolean is true (ie. this is me).
If you are the group leader the "leader" boolean is true.
If you follow someone the "follow" field shows who that is.
For each person the "stats" sub-table identifies statistics likely to be represented in a "stats bar" (in this case HP, Mana, Move). Buffs and debuffs are in their own tables - basically just string values which the client can display.
group = {
[1] = {
me = false,
combat = false,
leader = true,
debuffs = {
},
name = "Jerirath",
position = "standing",
buffs = {
[1] = "armor",
[2] = "bless",
[3] = "bless",
},
level = 4,
xp = {
max = 42550,
cur = 3944,
},
stats = {
Mana = {
max = 91,
cur = 91,
},
HP = {
max = 73,
cur = 73,
},
Move = {
max = 230,
cur = 230,
},
},
},
[2] = {
me = true,
combat = false,
follow = "Jerirath",
leader = false,
debuffs = {
},
name = "Nick",
position = "standing",
buffs = {
[1] = "bless",
[2] = "bless",
[3] = "armor",
},
level = 4,
xp = {
max = 42550,
cur = 489,
},
stats = {
Mana = {
max = 94,
cur = 94,
},
HP = {
max = 72,
cur = 67,
},
Move = {
max = 230,
cur = 230,
},
},
},
},
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|