(621dbfdd2) Humpback: Modified bilge to make it easier for ai to fix. Added ballast space to make use of extra space. Dugong: Added ballast space to make use of extra space.
This commit is contained in:
@@ -1282,75 +1282,6 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadLobbyUpdate(NetIncomingMessage inc)
|
||||
{
|
||||
UInt16 listId = inc.ReadUInt16();
|
||||
List<TempClient> tempClients = new List<TempClient>();
|
||||
int clientCount = inc.ReadByte();
|
||||
for (int i = 0; i < clientCount; i++)
|
||||
{
|
||||
byte id = inc.ReadByte();
|
||||
string name = inc.ReadString();
|
||||
UInt16 characterID = inc.ReadUInt16();
|
||||
bool muted = inc.ReadBoolean();
|
||||
inc.ReadPadBits();
|
||||
|
||||
tempClients.Add(new TempClient
|
||||
{
|
||||
ID = id,
|
||||
Name = name,
|
||||
CharacterID = characterID,
|
||||
Muted = muted
|
||||
});
|
||||
}
|
||||
|
||||
if (NetIdUtils.IdMoreRecent(listId, LastClientListUpdateID))
|
||||
{
|
||||
bool updateClientListId = true;
|
||||
List<Client> currentClients = new List<Client>();
|
||||
foreach (TempClient tc in tempClients)
|
||||
{
|
||||
//see if the client already exists
|
||||
var existingClient = ConnectedClients.Find(c => c.ID == tc.ID && c.Name == tc.Name);
|
||||
if (existingClient == null) //if not, create it
|
||||
{
|
||||
existingClient = new Client(tc.Name, tc.ID)
|
||||
{
|
||||
Muted = tc.Muted
|
||||
};
|
||||
ConnectedClients.Add(existingClient);
|
||||
GameMain.NetLobbyScreen.AddPlayer(existingClient);
|
||||
}
|
||||
existingClient.Character = null;
|
||||
existingClient.Muted = tc.Muted;
|
||||
if (tc.CharacterID > 0)
|
||||
{
|
||||
existingClient.Character = Entity.FindEntityByID(tc.CharacterID) as Character;
|
||||
if (existingClient.Character == null)
|
||||
{
|
||||
updateClientListId = false;
|
||||
}
|
||||
}
|
||||
if (existingClient.ID == myID)
|
||||
{
|
||||
existingClient.SetPermissions(permissions, permittedConsoleCommands);
|
||||
}
|
||||
currentClients.Add(existingClient);
|
||||
}
|
||||
//remove clients that aren't present anymore
|
||||
for (int i = ConnectedClients.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (!currentClients.Contains(ConnectedClients[i]))
|
||||
{
|
||||
GameMain.NetLobbyScreen.RemovePlayer(ConnectedClients[i]);
|
||||
ConnectedClients[i].Dispose();
|
||||
ConnectedClients.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
if (updateClientListId) LastClientListUpdateID = listId;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadLobbyUpdate(NetIncomingMessage inc)
|
||||
{
|
||||
ServerNetObject objHeader;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user