Send() public method

public Send ( GameDataPacket packet ) : bool
packet GameDataPacket
return bool
Example #1
0
 public void MoveHandCard(int from, int to)
 {
     networkService.Send(new HandCardMovementNotification()
     {
         From = from, To = to, PlayerItem = PlayerItem.Parse(SelfId)
     });
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isReplay">Set true if this is client is connected to a replayFile</param>
        /// <param name="replayStream"></param>
        /// <exception cref="System.ArgumentOutOfRangeException" />
        /// <exception cref="System.Net.Sockets.SocketException" />
        public void Start(Stream recordStream, LoginToken?token = null)
        {
            RecordStream = recordStream;
            IPEndPoint ep     = new IPEndPoint(IPAddress.Parse(IpString), PortNumber);
            TcpClient  client = new TcpClient();

            client.Connect(ep);
            NetworkStream stream = client.GetStream();

            networkService            = new ClientGamer();
            networkService.DataStream = new RecordTakingInputStream(stream, recordStream);
            if (token != null)
            {
                networkService.Send(new ConnectionRequest()
                {
                    Token = (LoginToken)token
                });
            }
        }
Example #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="isReplay">Set true if this is client is connected to a replayFile</param>
 /// <param name="replayStream"></param>
 /// <exception cref="System.ArgumentOutOfRangeException" />
 /// <exception cref="System.Net.Sockets.SocketException" />
 public void Start(Stream recordStream, LoginToken? token = null)
 {
     RecordStream = recordStream;
     IPEndPoint ep = new IPEndPoint(IPAddress.Parse(IpString), PortNumber);
     TcpClient client = new TcpClient();
     client.Connect(ep);
     NetworkStream stream = client.GetStream();
     networkService = new ClientGamer();
     networkService.DataStream = new RecordTakingInputStream(stream, recordStream);
     if (token != null)
     {
         networkService.Send(new ConnectionRequest() { Token = (LoginToken)token });
     }
 }