Closed amos1814 closed 5 years ago
Also add a message in chat for logging in and out
Thinking about it again, it seems that this issue is a good chance to talk about session end behavior more broadly. I suggest we build from this protocol for the following cases:
When any party member, player, or npc has health <= 0, then the server can send that player's "inventory"
for looting, and block any further actions by that entity. This requires a looting UI and looting interface. A dead player may observe (receive real-time data) and chat and without exiting from the party, with a new "dead" status visible in the UI for other party members. If there is a resurrection ability, it can happen here because the player is still taking up their slot and observing. Being kicked out, logging out when dead, and exiting the party will disassociate the player from the party and open a slot for a new player to join. By the way, we could have an advanced feature later to ban kicked out players so they can't rejoin.
Anyway what do you think?
One more thing, status
is probably the wrong name for this variable. Can we do "online": bool
instead?
96b0324 includes changes that will show a player as offline if online: false
and a player as dead if health <= 0
. There is no handling of the npc
field, so that can be removed.
After server has implemented online: bool
, I will adjust the logic to check for online: true
instead of false.
Change party generation
Old: Every party member is generated when party is created
New: Party member is generated upon joining a party
Max party size is 3 for now
While you're at it, I found a bug where the current party member shows up as online: false, self: true
while the leftover npc characters have online: true
.
The avatar doesn't disappear when a player logs out. Should we make it so it does?
{
"payload": {
"messages": [{"text": "b has logged out."}],
"party": [{
"online": false,
"id": 1
}]
},
"type": "UPDATE"
}
I made it so the avatar grays out to communicate offline status. The avatar is still there unless that party member is removed from the group.
By the way I found a bug with the new implementation: if I am in a party and someone else joins or logs in, then the other player's data has self: true
. The result is that multiple players have the red background which is supposed to indicate self: true
.
Overall this is a lot better though thanks :+1:
I'll fix that right now forgot about the self field
Get rid of "NPC" field in party member list
Only player-controlled party members will be tracked. When a party member logs out, the following update will be sent:
Similarly when a party member logs in