Exemple #1
0
 public void NewConnection(Socket sockClient)
 {
     var client = new Player(sockClient);
     Console.WriteLine("Client {0}, joined", client.Sock.RemoteEndPoint);
     var args = new List<SerializableType>();
     var message = new SimpleMessage {Message = "Hello"};
     args.Add(message);
     var remoteMethod = new RemoteInvokeMethod("Handler", Command.Connect.ToString(), args);
     var bytes = RemoteInvokeMethod.WriteToStream(remoteMethod);
     client.Sock.Send(bytes, bytes.Length, SocketFlags.None);
     client.SetupRecieveCallback();
 }
Exemple #2
0
 public RemoteInvokeMethod InitializeBoard(SimpleMessage message)
 {
     return Games[message.Message].GetHeroes();
 }