Exemplo n.º 1
0
        private void TryConnect(int netVersion, Event @event)
        {
            byte[] MAC       = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
            byte[] consoleID = Utility.GetRandomU64();

            using (MemoryStream ms = new MemoryStream())
            {
                using (CustomBinaryWriter bw = new CustomBinaryWriter(ms))
                {
                    bw.Write((byte)RoomMessageTypes.IdJoinRequest);
                    bw.Write(loginData.Nickname);
                    bw.Write(consoleID.ToString());
                    bw.Write(MAC);
                    bw.Write((UInt32)netVersion);
                    bw.Write(loginData.Password);
                    bw.Write("");
                }
                System.Diagnostics.Debug.WriteLine(BitConverter.ToString(ms.ToArray()));
                server.Send(@event.ChannelID, ms.ToArray(), PacketFlags.Reliable);
            }

            using (MemoryStream ms = new MemoryStream())
            {
                using (CustomBinaryWriter bw = new CustomBinaryWriter(ms))
                {
                    bw.Write((byte)RoomMessageTypes.IdSetGameInfo);
                    bw.Write("Citra Rooms");
                    bw.Write((UInt64)1);
                }
                server.Send(@event.ChannelID, ms.ToArray(), PacketFlags.Reliable);
            }
        }
Exemplo n.º 2
0
 public void SendChatMessage(String message)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         using (CustomBinaryWriter bw = new CustomBinaryWriter(ms))
         {
             bw.Write((byte)RoomMessageTypes.IdChatMessage);
             bw.Write(message);
         }
         server.Send(0, ms.ToArray(), PacketFlags.Reliable);
     }
 }