Fixed lobby chat
This commit is contained in:
@@ -57,8 +57,11 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
TextWithSender = string.IsNullOrWhiteSpace(senderName) ? text : senderName + ": " + text;
|
TextWithSender = string.IsNullOrWhiteSpace(senderName) ? text : senderName + ": " + text;
|
||||||
|
|
||||||
LastID++;
|
if (GameMain.Server != null)
|
||||||
netStateID = LastID;
|
{
|
||||||
|
LastID++;
|
||||||
|
netStateID = LastID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ChatMessage Create(string senderName, string text, ChatMessageType type, Character sender)
|
public static ChatMessage Create(string senderName, string text, ChatMessageType type, Character sender)
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace Barotrauma.Networking
|
|||||||
private string saltedPw;
|
private string saltedPw;
|
||||||
|
|
||||||
private UInt32 lastSentChatMsgID = 0; //last message this client has successfully sent
|
private UInt32 lastSentChatMsgID = 0; //last message this client has successfully sent
|
||||||
|
private UInt32 lastQueueChatMsgID = 0; //last message added to the queue
|
||||||
private List<ChatMessage> chatMsgQueue = new List<ChatMessage>();
|
private List<ChatMessage> chatMsgQueue = new List<ChatMessage>();
|
||||||
|
|
||||||
public byte ID
|
public byte ID
|
||||||
@@ -617,6 +618,9 @@ namespace Barotrauma.Networking
|
|||||||
gameStarted && myCharacter != null ? myCharacter.Name : name,
|
gameStarted && myCharacter != null ? myCharacter.Name : name,
|
||||||
message, (ChatMessageType)type, gameStarted ? myCharacter : null);
|
message, (ChatMessageType)type, gameStarted ? myCharacter : null);
|
||||||
|
|
||||||
|
lastQueueChatMsgID++;
|
||||||
|
chatMessage.netStateID = lastQueueChatMsgID;
|
||||||
|
|
||||||
chatMsgQueue.Add(chatMessage);
|
chatMsgQueue.Add(chatMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user