Added lobby chat syncing

This commit is contained in:
juanjp600
2016-09-01 20:45:43 -03:00
parent fc457e0f18
commit 028c3a8bc1
7 changed files with 366 additions and 209 deletions

View File

@@ -9,21 +9,36 @@ using Barotrauma.Items.Components;
namespace Barotrauma.Networking
{
enum ClientPacketHeader
{
REQUEST_AUTH, //ask the server if a password is needed, if so we'll get nonce for encryption
REQUEST_INIT, //ask the server to give you initialization
UPDATE_LOBBY, //update state in lobby
UPDATE_INGAME_ALIVE, //update state ingame while alive (allow character input)
UPDATE_INGAME_SPECTATING, //update state ingame while spectating/dead
enum ClientPacketHeader
{
REQUEST_AUTH, //ask the server if a password is needed, if so we'll get nonce for encryption
REQUEST_INIT, //ask the server to give you initialization
UPDATE_LOBBY, //update state in lobby
UPDATE_INGAME, //update state ingame while alive
}
enum ServerPacketHeader
enum ClientNetObject
{
AUTH_RESPONSE, //tell the player if they require a password to log in
AUTH_FAILURE, //the server won't authorize player yet, however connection is still alive
UPDATE_LOBBY, //update state in lobby (votes and chat messages)
UPDATE_INGAME_ALIVE, //update state ingame while alive (character input and chat messages)
UPDATE_INGAME_SPECTATING, //update state ingame while spectating/dead (chat messages)
END_OF_MESSAGE, //self-explanatory
CHAT_MESSAGE, //also self-explanatory
VOTE, //you get the idea
CHARACTER_INPUT,
ITEM_INTERACTION
}
enum ServerPacketHeader
{
AUTH_RESPONSE, //tell the player if they require a password to log in
AUTH_FAILURE, //the server won't authorize player yet, however connection is still alive
UPDATE_LOBBY, //update state in lobby (votes and chat messages)
UPDATE_INGAME, //update state ingame while alive (character input and chat messages)
}
enum ServerNetObject
{
END_OF_MESSAGE,
CHAT_MESSAGE,
VOTE,
CHARACTER_POSITION,
ITEM_STATE
}
enum VoteType