public GameBoardScreen() : base("GameBoardScreen") { GNet.OnGotMessage += GNet_OnGotMessage; // Hail the opponent GNet.SendMessage(Systems.MessageType.Hail, GSettings.Name); MyNameLabel = GetMenuItem <MLabel>("MyName"); OpponentNameLabel = GetMenuItem <MLabel>("OpponentName"); }
void StartServerGame() { NetOutgoingMessage _message; Player1 = GScene.Create <Player>(); Player1.IsServer = true; _message = GNet.CreateMessage(); _message.Write((byte)Systems.ObjectType.Player); Player.CreateSpec.Serialize(Player1, _message); GNet.SendMessage(Systems.MessageType.CreateObject, _message); Player2 = GScene.Create <Player>(); Player2.IsServer = false; _message = GNet.CreateMessage(); _message.Write((byte)Systems.ObjectType.Player); Player.CreateSpec.Serialize(Player2, _message); GNet.SendMessage(Systems.MessageType.CreateObject, _message); _Started = true; }