Possible to use the same sub as the main submarine and the respawn shuttle, fixed duplicate client names in netlobby if reconnecting before the server has disconnected the client, fixed "end round" button not appearing when joining mid-round
This commit is contained in:
@@ -386,6 +386,10 @@ namespace Barotrauma.Networking
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
#if DEBUG
|
||||
if (PlayerInput.GetKeyboardState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.P)) return;
|
||||
#endif
|
||||
|
||||
base.Update(deltaTime);
|
||||
|
||||
if (!connected) return;
|
||||
@@ -736,22 +740,6 @@ namespace Barotrauma.Networking
|
||||
|
||||
crew.Add(newCharacter);
|
||||
}
|
||||
//int count = inc.ReadByte();
|
||||
//for (int n = 0; n < count; n++)
|
||||
//{
|
||||
// byte id = inc.ReadByte();
|
||||
// Character newCharacter = ReadCharacterData(inc, id == myID);
|
||||
|
||||
// if (id != myID)
|
||||
// {
|
||||
// var characterOwner = otherClients.Find(c => c.ID == id);
|
||||
// if (characterOwner != null) characterOwner.Character = newCharacter;
|
||||
// }
|
||||
|
||||
// crew.Add(newCharacter);
|
||||
|
||||
// yield return CoroutineStatus.Running;
|
||||
//}
|
||||
}
|
||||
|
||||
gameStarted = true;
|
||||
@@ -1107,11 +1095,6 @@ namespace Barotrauma.Networking
|
||||
|
||||
character.ID = ID;
|
||||
|
||||
//WayPoint spawnPoint = Entity.FindEntityByID(spawnPointID) as WayPoint;
|
||||
//if (spawnPoint != null)
|
||||
//{
|
||||
// //character.GiveJobItems(spawnPoint);
|
||||
//}
|
||||
|
||||
Item.Spawner.ReadNetworkData(inc);
|
||||
|
||||
@@ -1120,6 +1103,8 @@ namespace Barotrauma.Networking
|
||||
myCharacter = character;
|
||||
Character.Controlled = character;
|
||||
GameMain.LightManager.LosEnabled = true;
|
||||
|
||||
if (endRoundButton != null) endRoundButton.Visible = Voting.AllowEndVoting;
|
||||
}
|
||||
|
||||
return character;
|
||||
|
||||
@@ -457,6 +457,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
//AssignJobs();
|
||||
|
||||
GameMain.NetLobbyScreen.RemovePlayer(sender.name);
|
||||
GameMain.NetLobbyScreen.AddPlayer(sender.name);
|
||||
|
||||
// Notify the client that they have logged in
|
||||
@@ -1301,6 +1302,8 @@ namespace Barotrauma.Networking
|
||||
client.Character.Kill(CauseOfDeath.Disconnected, true);
|
||||
}
|
||||
|
||||
client.Character = null;
|
||||
client.inGame = false;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(msg)) msg = client.name + " has left the server";
|
||||
if (string.IsNullOrWhiteSpace(targetmsg)) targetmsg = "You have left the server";
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
this.networkMember = networkMember;
|
||||
|
||||
respawnShuttle = shuttle;
|
||||
respawnShuttle = new Submarine(shuttle.FilePath, shuttle.MD5Hash.Hash, true);
|
||||
respawnShuttle.Load(false);
|
||||
|
||||
ResetShuttle();
|
||||
|
||||
Reference in New Issue
Block a user