Browse Source

Merge branch 'master' of https://bitbucket.org/JoshuaReason/ggj-2019

# Conflicts:
#	Assets/Scenes/ClientScene.unity
master
MB 5 years ago
parent
commit
079247f768
6 changed files with 56 additions and 2789 deletions
  1. +22
    -2787
      Assets/Scenes/ClientScene.unity
  2. +1
    -0
      Assets/Scipts/Multiplayer/Core/LoginProtocol.cs
  3. +25
    -0
      Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs
  4. +3
    -0
      Assets/Scipts/Multiplayer/Server/LoginManager.cs
  5. +3
    -0
      Assets/Scipts/Multiplayer/Server/ServerManager.cs
  6. +2
    -2
      ProjectSettings/ProjectSettings.asset

+ 22
- 2787
Assets/Scenes/ClientScene.unity
File diff suppressed because it is too large
View File


+ 1
- 0
Assets/Scipts/Multiplayer/Core/LoginProtocol.cs View File

@ -10,5 +10,6 @@ namespace Multiplayer
public const short Name = 301;
public const short EnterLobby = 302;
public const short LobbyCount = 303;
public const short Seed = 304;
}
}

+ 25
- 0
Assets/Scipts/Multiplayer/Core/PlayerProtocol.cs View File

@ -93,6 +93,31 @@ namespace Multiplayer
}
public class longMsg : PlayerMsg
{
public long Long;
public longMsg() { }
public longMsg(byte PlayerID, long Long) : base(PlayerID)
{
this.Long = Long;
}
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write(Long);
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
Long = reader.ReadInt64();
}
}
public class StringMsg : PlayerMsg
{

+ 3
- 0
Assets/Scipts/Multiplayer/Server/LoginManager.cs View File

@ -72,7 +72,10 @@ namespace Multiplayer
private void StartGame()
{
foreach (Player player in ServerManager.AllPlayers.Values)
{
//player.Connection.Send(LoginMsgID.Seed, new longMsg(player.ID, ServerManager.Seed));
player.Connection.Send(PlayerMsgID.GameStart, new PlayerMsg(player.ID));
}
}
private void GoToLobby()

+ 3
- 0
Assets/Scipts/Multiplayer/Server/ServerManager.cs View File

@ -16,6 +16,7 @@ namespace Multiplayer
[SerializeField]
private int Port = 4444;
public long Seed;
public Dictionary<int, Player> AllPlayers;
@ -49,6 +50,8 @@ namespace Multiplayer
loginManager = new LoginManager(this);
playerManager = new PlayerServerManager(this);
Seed = System.DateTime.Now.Ticks;
Server.Listen(Port);
}

+ 2
- 2
ProjectSettings/ProjectSettings.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d31e33f772a9cd3cd56ae66a5b981bb456d1201adab8595fc0337bc8261d1cfc
size 17761
oid sha256:04c64ffa91d234bb532dee94ea9a205db3d37fe73723ed630fae3a154ed9266d
size 17790

Loading…
Cancel
Save