Fixes for the new update
This commit is contained in:
@@ -340,13 +340,11 @@ namespace Barotrauma
|
||||
public static Submarine GetRespawnSub()
|
||||
{
|
||||
#if SERVER
|
||||
if (GameMain.Server.RespawnManager == null)
|
||||
return null;
|
||||
return GameMain.Server.RespawnManager.RespawnShuttle;
|
||||
if (GameMain.Server.RespawnManager == null) { return null; }
|
||||
return GameMain.Server.RespawnManager.GetShuttle(CharacterTeamType.Team1);
|
||||
#else
|
||||
if (GameMain.Client.RespawnManager == null)
|
||||
return null;
|
||||
return GameMain.Client.RespawnManager.RespawnShuttle;
|
||||
if (GameMain.Client.RespawnManager == null) { return null; }
|
||||
return GameMain.Client.RespawnManager.GetShuttle(CharacterTeamType.Team1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -470,18 +468,18 @@ namespace Barotrauma
|
||||
public void SaveGame(string path)
|
||||
{
|
||||
if (!LuaCsFile.CanWriteToPath(path)) { throw new ScriptRuntimeException($"Saving files to {path} is disallowed."); }
|
||||
SaveUtil.SaveGame(path);
|
||||
SaveUtil.SaveGame(CampaignDataPath.CreateRegular(path));
|
||||
}
|
||||
|
||||
public void LoadGame(string path)
|
||||
{
|
||||
SaveUtil.LoadGame(path);
|
||||
SaveUtil.LoadGame(CampaignDataPath.CreateRegular(path));
|
||||
}
|
||||
|
||||
#if SERVER
|
||||
public void LoadCampaign(string path, Client client = null)
|
||||
{
|
||||
MultiPlayerCampaign.LoadCampaign(path, client);
|
||||
MultiPlayerCampaign.LoadCampaign(CampaignDataPath.CreateRegular(path), client);
|
||||
}
|
||||
|
||||
public static void SendMessage(string msg, ChatMessageType? messageType = null, Client sender = null, Character character = null)
|
||||
@@ -513,10 +511,10 @@ namespace Barotrauma
|
||||
|
||||
public static void DispatchRespawnSub()
|
||||
{
|
||||
GameMain.Server.RespawnManager.DispatchShuttle();
|
||||
GameMain.Server.RespawnManager.DispatchShuttle(GameMain.Server.RespawnManager.GetTeamSpecificState(CharacterTeamType.Team1));
|
||||
}
|
||||
|
||||
public static bool StartGame()
|
||||
public static GameServer.TryStartGameResult StartGame()
|
||||
{
|
||||
return GameMain.Server.TryStartGame();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Barotrauma.Networking
|
||||
private readonly Dictionary<CharacterTeamType, List<Door>> shuttleDoors = new Dictionary<CharacterTeamType, List<Door>>();
|
||||
private readonly Dictionary<CharacterTeamType, List<ItemContainer>> respawnContainers = new Dictionary<CharacterTeamType, List<ItemContainer>>();
|
||||
|
||||
private class TeamSpecificState
|
||||
public class TeamSpecificState
|
||||
{
|
||||
public readonly CharacterTeamType TeamID;
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
partial void UpdateReturningProjSpecific(TeamSpecificState teamSpecificState, float deltaTime);
|
||||
|
||||
private Submarine GetShuttle(CharacterTeamType team)
|
||||
public Submarine GetShuttle(CharacterTeamType team)
|
||||
{
|
||||
if (respawnShuttles.TryGetValue(team, out Submarine sub))
|
||||
{
|
||||
@@ -276,6 +276,16 @@ namespace Barotrauma.Networking
|
||||
return null;
|
||||
}
|
||||
|
||||
public TeamSpecificState GetTeamSpecificState(CharacterTeamType team)
|
||||
{
|
||||
if (teamSpecificStates.TryGetValue(team, out TeamSpecificState state))
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void ResetShuttle(TeamSpecificState teamSpecificState)
|
||||
{
|
||||
teamSpecificState.ReturnTime = DateTime.Now + new TimeSpan(0, 0, 0, 0, milliseconds: (int)(maxTransportTime * 1000));
|
||||
|
||||
Reference in New Issue
Block a user