(a00338777) v0.9.2.1
This commit is contained in:
@@ -6,7 +6,7 @@ using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
abstract class CampaignMode : GameMode
|
||||
abstract partial class CampaignMode : GameMode
|
||||
{
|
||||
public readonly CargoManager CargoManager;
|
||||
|
||||
@@ -111,9 +111,8 @@ namespace Barotrauma
|
||||
base.Update(deltaTime);
|
||||
|
||||
if (!IsRunning) { return; }
|
||||
#if CLIENT
|
||||
if (GameMain.Client != null) { return; }
|
||||
#endif
|
||||
if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) { return; }
|
||||
|
||||
if (!watchmenSpawned)
|
||||
{
|
||||
if (Level.Loaded.StartOutpost != null) { startWatchman = SpawnWatchman(Level.Loaded.StartOutpost); }
|
||||
@@ -128,7 +127,7 @@ namespace Barotrauma
|
||||
foreach (Character character in Character.CharacterList)
|
||||
{
|
||||
#if SERVER
|
||||
if (string.IsNullOrEmpty(character.OwnerClientIP)) { continue; }
|
||||
if (string.IsNullOrEmpty(character.OwnerClientEndPoint)) { continue; }
|
||||
#else
|
||||
if (!CrewManager.GetCharacters().Contains(character)) { continue; }
|
||||
#endif
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Barotrauma
|
||||
|
||||
public readonly string Name;
|
||||
|
||||
public string ClientIP
|
||||
public string ClientEndPoint
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
@@ -42,7 +42,7 @@ namespace Barotrauma
|
||||
public CharacterCampaignData(XElement element)
|
||||
{
|
||||
Name = element.GetAttributeString("name", "Unnamed");
|
||||
ClientIP = element.GetAttributeString("ip", "");
|
||||
ClientEndPoint = element.GetAttributeString("endpoint", null) ?? element.GetAttributeString("ip", "");
|
||||
string steamID = element.GetAttributeString("steamid", "");
|
||||
if (!string.IsNullOrEmpty(steamID))
|
||||
{
|
||||
@@ -69,7 +69,7 @@ namespace Barotrauma
|
||||
{
|
||||
XElement element = new XElement("CharacterCampaignData",
|
||||
new XAttribute("name", Name),
|
||||
new XAttribute("ip", ClientIP),
|
||||
new XAttribute("endpoint", ClientEndPoint),
|
||||
new XAttribute("steamid", SteamID));
|
||||
|
||||
CharacterInfo?.Save(element);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Barotrauma
|
||||
isRunning = true;
|
||||
}
|
||||
|
||||
public virtual void MsgBox() { }
|
||||
public virtual void ShowStartMessage() { }
|
||||
|
||||
public virtual void AddToGUIUpdateList()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Lidgren.Network;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
@@ -98,14 +97,11 @@ namespace Barotrauma
|
||||
|
||||
GameMain.GameSession.EndRound("");
|
||||
|
||||
//client character has spawned this round -> remove old data (and replace with an up-to-date one if the client still has an alive character)
|
||||
characterData.RemoveAll(cd => cd.HasSpawned);
|
||||
|
||||
foreach (Client c in GameMain.Server.ConnectedClients)
|
||||
{
|
||||
if (c.HasSpawned)
|
||||
{
|
||||
//client has spawned this round -> remove old data (and replace with new one if the client still has an alive character)
|
||||
characterData.RemoveAll(cd => cd.MatchesClient(c));
|
||||
}
|
||||
|
||||
if (c.Character?.Info != null && !c.Character.IsDead)
|
||||
{
|
||||
characterData.Add(new CharacterCampaignData(c));
|
||||
|
||||
Reference in New Issue
Block a user