misc UI stuff, gamesession additions, limbs don't have individual health anymore, background music
This commit is contained in:
@@ -134,11 +134,11 @@ namespace Subsurface.Networking
|
||||
int existingClients = inc.ReadInt32();
|
||||
for (int i = 1; i <= existingClients; i++)
|
||||
{
|
||||
Game1.netLobbyScreen.AddPlayer(inc.ReadString());
|
||||
Game1.NetLobbyScreen.AddPlayer(inc.ReadString());
|
||||
}
|
||||
|
||||
//add the name of own client to the lobby screen
|
||||
Game1.netLobbyScreen.AddPlayer(name);
|
||||
Game1.NetLobbyScreen.AddPlayer(name);
|
||||
|
||||
CanStart = true;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace Subsurface.Networking
|
||||
string msg = inc.ReadString();
|
||||
DebugConsole.ThrowError(msg);
|
||||
|
||||
Game1.mainMenuScreen.Select();
|
||||
Game1.MainMenuScreen.Select();
|
||||
}
|
||||
break;
|
||||
case NetIncomingMessageType.StatusChanged:
|
||||
@@ -172,8 +172,8 @@ namespace Subsurface.Networking
|
||||
if (myCharacter.IsDead)
|
||||
{
|
||||
Character.Controlled = null;
|
||||
Game1.gameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
Game1.gameScreen.Cam.Zoom = 1.0f;
|
||||
Game1.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
Game1.GameScreen.Cam.Zoom = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -228,7 +228,7 @@ namespace Subsurface.Networking
|
||||
string mapName = inc.ReadString();
|
||||
string mapHash = inc.ReadString();
|
||||
|
||||
Game1.netLobbyScreen.TrySelectMap(mapName, mapHash);
|
||||
Game1.NetLobbyScreen.TrySelectMap(mapName, mapHash);
|
||||
|
||||
|
||||
//Map.Load(mapFile);
|
||||
@@ -240,8 +240,8 @@ namespace Subsurface.Networking
|
||||
TimeSpan duration = new TimeSpan(0,(int)durationMinutes,0);
|
||||
|
||||
//int gameModeIndex = inc.ReadInt32();
|
||||
Game1.gameSession = new GameSession("", false, duration);
|
||||
Game1.gameSession.StartShift(1);
|
||||
Game1.GameSession = new GameSession("", false, duration);
|
||||
Game1.GameSession.StartShift(1);
|
||||
|
||||
myCharacter = ReadCharacterData(inc);
|
||||
Character.Controlled = myCharacter;
|
||||
@@ -254,7 +254,7 @@ namespace Subsurface.Networking
|
||||
|
||||
gameStarted = true;
|
||||
|
||||
Game1.gameScreen.Select();
|
||||
Game1.GameScreen.Select();
|
||||
|
||||
AddChatMessage("Press TAB to chat", ChatMessageType.Server);
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace Subsurface.Networking
|
||||
Client otherClient = new Client();
|
||||
otherClient.name = inc.ReadString();
|
||||
|
||||
Game1.netLobbyScreen.AddPlayer(otherClient.name);
|
||||
Game1.NetLobbyScreen.AddPlayer(otherClient.name);
|
||||
|
||||
//string newPlayerName = inc.ReadString();
|
||||
//int newPlayerID = inc.ReadInt32();
|
||||
@@ -285,7 +285,7 @@ namespace Subsurface.Networking
|
||||
string leavingName = inc.ReadString();
|
||||
|
||||
AddChatMessage(inc.ReadString(), ChatMessageType.Server);
|
||||
Game1.netLobbyScreen.RemovePlayer(leavingName);
|
||||
Game1.NetLobbyScreen.RemovePlayer(leavingName);
|
||||
break;
|
||||
|
||||
case (byte)PacketTypes.KickedOut:
|
||||
@@ -293,7 +293,7 @@ namespace Subsurface.Networking
|
||||
|
||||
DebugConsole.ThrowError(msg);
|
||||
|
||||
Game1.mainMenuScreen.Select();
|
||||
Game1.MainMenuScreen.Select();
|
||||
|
||||
break;
|
||||
case (byte)PacketTypes.Chatmessage:
|
||||
@@ -307,13 +307,13 @@ namespace Subsurface.Networking
|
||||
break;
|
||||
case (byte)PacketTypes.UpdateNetLobby:
|
||||
if (gameStarted) continue;
|
||||
Game1.netLobbyScreen.ReadData(inc);
|
||||
Game1.NetLobbyScreen.ReadData(inc);
|
||||
break;
|
||||
case (byte)PacketTypes.Traitor:
|
||||
string targetName = inc.ReadString();
|
||||
|
||||
Game1.gameSession.NewChatMessage("You are an agent of Ordo Europae", messageColor[(int)ChatMessageType.Server]);
|
||||
Game1.gameSession.NewChatMessage("Your secret task is to assassinate " + targetName + "!", messageColor[(int)ChatMessageType.Server]);
|
||||
Game1.GameSession.NewChatMessage("You are an agent of Ordo Europae", messageColor[(int)ChatMessageType.Server]);
|
||||
Game1.GameSession.NewChatMessage("Your secret task is to assassinate " + targetName + "!", messageColor[(int)ChatMessageType.Server]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -325,9 +325,9 @@ namespace Subsurface.Networking
|
||||
{
|
||||
Map.Unload();
|
||||
|
||||
Game1.netLobbyScreen.Select();
|
||||
Game1.NetLobbyScreen.Select();
|
||||
|
||||
if (Game1.gameSession!=null) Game1.gameSession.EndShift(null, null);
|
||||
if (Game1.GameSession!=null) Game1.GameSession.EndShift(null, null);
|
||||
|
||||
DebugConsole.ThrowError(endMessage);
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace Subsurface.Networking
|
||||
else
|
||||
{
|
||||
|
||||
Game1.netLobbyScreen.AddPlayer(sender.name);
|
||||
Game1.NetLobbyScreen.AddPlayer(sender.name);
|
||||
|
||||
// Notify the client that they have logged in
|
||||
outmsg = Server.CreateMessage();
|
||||
@@ -271,12 +271,12 @@ namespace Subsurface.Networking
|
||||
int seed = DateTime.Now.Millisecond;
|
||||
Game1.random = new Random(seed);
|
||||
|
||||
Map selectedMap = Game1.netLobbyScreen.SelectedMap as Map;
|
||||
Map selectedMap = Game1.NetLobbyScreen.SelectedMap as Map;
|
||||
|
||||
selectedMap.Load();
|
||||
|
||||
Game1.gameSession = new GameSession("", false, Game1.netLobbyScreen.GameDuration, Game1.netLobbyScreen.SelectedMode);
|
||||
Game1.gameSession.StartShift(1);
|
||||
Game1.GameSession = new GameSession("", false, Game1.NetLobbyScreen.GameDuration, Game1.NetLobbyScreen.SelectedMode);
|
||||
Game1.GameSession.StartShift(1);
|
||||
//EventManager.SelectEvent(Game1.netLobbyScreen.SelectedEvent);
|
||||
|
||||
foreach (Client client in connectedClients)
|
||||
@@ -307,10 +307,10 @@ namespace Subsurface.Networking
|
||||
|
||||
msg.Write(seed);
|
||||
|
||||
msg.Write(Game1.netLobbyScreen.SelectedMap.Name);
|
||||
msg.Write(Game1.netLobbyScreen.SelectedMap.MapHash.MD5Hash);
|
||||
msg.Write(Game1.NetLobbyScreen.SelectedMap.Name);
|
||||
msg.Write(Game1.NetLobbyScreen.SelectedMap.MapHash.MD5Hash);
|
||||
|
||||
msg.Write(Game1.netLobbyScreen.GameDuration.TotalMinutes);
|
||||
msg.Write(Game1.NetLobbyScreen.GameDuration.TotalMinutes);
|
||||
|
||||
WriteCharacterData(msg, client.name, client.character);
|
||||
|
||||
@@ -331,9 +331,9 @@ namespace Subsurface.Networking
|
||||
|
||||
gameStarted = true;
|
||||
|
||||
Game1.gameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
Game1.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
|
||||
Game1.gameScreen.Select();
|
||||
Game1.GameScreen.Select();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ namespace Subsurface.Networking
|
||||
}
|
||||
}
|
||||
|
||||
Game1.netLobbyScreen.Select();
|
||||
Game1.NetLobbyScreen.Select();
|
||||
|
||||
DebugConsole.ThrowError(endMessage);
|
||||
}
|
||||
@@ -394,7 +394,7 @@ namespace Subsurface.Networking
|
||||
outmsg.Write(client.name);
|
||||
outmsg.Write(msg);
|
||||
|
||||
Game1.netLobbyScreen.RemovePlayer(client.name);
|
||||
Game1.NetLobbyScreen.RemovePlayer(client.name);
|
||||
|
||||
if (Server.Connections.Count > 0)
|
||||
{
|
||||
@@ -435,7 +435,7 @@ namespace Subsurface.Networking
|
||||
{
|
||||
NetOutgoingMessage msg = Server.CreateMessage();
|
||||
msg.Write((byte)PacketTypes.UpdateNetLobby);
|
||||
Game1.netLobbyScreen.WriteData(msg);
|
||||
Game1.NetLobbyScreen.WriteData(msg);
|
||||
|
||||
if (Server.Connections.Count > 0)
|
||||
{
|
||||
|
||||
@@ -53,11 +53,11 @@ namespace Subsurface.Networking
|
||||
{
|
||||
if (isClient)
|
||||
{
|
||||
if (Game1.server != null) return;
|
||||
if (Game1.Server != null) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Game1.server == null) return;
|
||||
if (Game1.Server == null) return;
|
||||
}
|
||||
|
||||
eventType = type;
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace Subsurface.Networking
|
||||
|
||||
public void AddChatMessage(string message, ChatMessageType messageType)
|
||||
{
|
||||
Game1.netLobbyScreen.NewChatMessage(message, messageColor[(int)messageType]);
|
||||
if (Game1.gameSession != null) Game1.gameSession.NewChatMessage(message, messageColor[(int)messageType]);
|
||||
Game1.NetLobbyScreen.NewChatMessage(message, messageColor[(int)messageType]);
|
||||
if (Game1.GameSession != null) Game1.GameSession.NewChatMessage(message, messageColor[(int)messageType]);
|
||||
|
||||
GUI.PlayMessageSound();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user