コード例 #1
0
 public Packet253Auth(TcpClientm data,string s, byte[] k, byte[] t)
 {
     this.data = data;
     this.sid = s;
     this.key = k;
     this.token = t;
 }
コード例 #2
0
 public static void Read(TcpClientm d)
 {
     byte s;
     string a = "";
     try
     {
         s = d.NetStream.ReadByte(d);
         try
         {
             d.NetStream.ReadByte(d);
             ReadString(d, 255);
             d.NetStream.ReadInt16(d);
             s = d.NetStream.ReadByte(d);
             if (s >= 73)
             {
                 a = ReadString(d, 255);
                 int port = d.NetStream.ReadInt32(d);
             }
         }
         catch
         {
         }
     }
     catch
     {
         s = 0;
     }
     d.cli.onPing(s, a);
 }
コード例 #3
0
ファイル: NetExtensions.cs プロジェクト: Wroud/MCSClasic
 public static long ReadInt64(this NetworkStream reader, TcpClientm tc)
 {
     int count = 8;
     byte[] b = new byte[count];
     reader.Read(b, 0, count);
     b = b.Reverse();
     return BitConverter.ToInt64(b, 0);
 }
コード例 #4
0
 public static byte[] ReadBytes(this NetworkStream reader, TcpClientm tc, int count)
 {
     byte[] b = new byte[count];
     reader.Read(b, 0, count);
     if (tc.encrypted)
         b = tc.decryptCipher.ProcessBytes(b);
     return b;
 }
コード例 #5
0
 public static String ReadString(TcpClientm data, int max)
 {
     short chars = data.NetStream.ReadInt16(data);
     if (chars > max)
         return data.NetStream.ReadString(data, chars).Remove(max);
     else
         return data.NetStream.ReadString(data, chars);
 }
コード例 #6
0
 public static byte ReadByte(this NetworkStream reader, TcpClientm tc)
 {
     byte[] b = new byte[1];
     reader.Read(b, 0, 1);
     if (tc.encrypted)
         return tc.decryptCipher.ProcessByte(b[0])[0];
     else
         return b[0];
 }
コード例 #7
0
 public static long ReadInt64(this NetworkStream reader, TcpClientm tc)
 {
     int count = 8;
     byte[] b = new byte[count];
     reader.Read(b, 0, count);
     if (tc.encrypted)
         b = tc.decryptCipher.ProcessBytes(b);
     b = b.Reverse();
     return BitConverter.ToInt64(b, 0);
 }
コード例 #8
0
 public static string ReadString(this NetworkStream reader, TcpClientm tc, short len)
 {
     string s = "";
     for (int i = 0; i < len; i++)
     {
         byte[] b = reader.ReadBytes(tc, 2);
         s += UnicodeEncoding.BigEndianUnicode.GetChars(b)[0];
     }
     return s;
 }
コード例 #9
0
 public static void WriteBytes(TcpClientm d, byte[] b)
 {
     if (b != null)
     {
         d.Write((short)b.Length);
         d.Write(b);
     }
     else
         d.Write((short)0);
 }
コード例 #10
0
 public static void Read(TcpClientm d)
 {
     string s = ReadString(d, 7);
     byte dis = d.NetStream.ReadByte(d);
     byte v = d.NetStream.ReadByte(d);
     int chvs = v & 7;
     bool ccol = (v & 8) == 8;
     byte dif = d.NetStream.ReadByte(d);
     bool shc = d.NetStream.ReadByte(d) == 1;
     d.cli.onClientInfo(s, dis, chvs, ccol, dif, shc);
 }
コード例 #11
0
 public Packet252SharedKey(TcpClientm d, byte[] s, byte[] v)
 {
     this.data = d;
     this.sharedSecret = s;
     this.verifyToken = v;
 }
コード例 #12
0
 public static byte[] ReadBytes(TcpClientm d)
 {
     short lenght = d.NetStream.ReadInt16(d);
     return d.NetStream.ReadBytes(d, lenght);
 }
コード例 #13
0
ファイル: NetExtensions.cs プロジェクト: Wroud/MCSClasic
 public static byte[] ReadBytes(this NetworkStream reader, TcpClientm tc, int count)
 {
     byte[] b = new byte[count];
     reader.Read(b, 0, count);
     return b;
 }
コード例 #14
0
ファイル: NetExtensions.cs プロジェクト: Wroud/MCSClasic
 public static string ReadString(this NetworkStream reader, TcpClientm tc)
 {
     return new string(UnicodeEncoding.ASCII.GetChars(reader.ReadBytes(tc, 64))).TrimEnd();
 }
コード例 #15
0
 public Packet255Kick(TcpClientm d,string mes)
 {
     this.data = d;
     this.messag = mes;
 }
コード例 #16
0
 public Packet0KeepAlive(TcpClientm d,int r)
 {
     this.data = d;
     this.rand = r;
 }
コード例 #17
0
 public Packet0KeepAlive(TcpClientm data)
 {
     this.data = data;
 }
コード例 #18
0
 public static Packet Read(TcpClientm d)
 {
     return null;
 }
コード例 #19
0
 public static void Read(TcpClientm d)
 {
     int r = d.NetStream.ReadInt32(d);
     //return new Packet0KeepAlive(d,r);
 }
コード例 #20
0
 public Packet253Auth(TcpClientm data)
 {
     this.data = data;
 }
コード例 #21
0
ファイル: NetExtensions.cs プロジェクト: Wroud/MCSClasic
 public static byte ReadByte(this NetworkStream reader, TcpClientm tc)
 {
     byte[] b = new byte[1];
     reader.Read(b, 0, 1);
     return b[0];
 }
コード例 #22
0
 public static void WriteString(TcpClientm d, string s)
 {
     d.Write((short)s.Length);
     if (s.Length > 0)
         d.Write(s);
 }
コード例 #23
0
 public Packet252SharedKey(TcpClientm data)
 {
     this.data = data;
 }
コード例 #24
0
 public Packet1Login(TcpClientm d)
 {
     this.data = d;
 }
コード例 #25
0
 public static void Read(TcpClientm d)
 {
     string s = ReadString(d, 20);
     byte[] sd = ReadBytes(d);
 }
コード例 #26
0
 public Packet250CustomPayload(TcpClientm d)
 {
     this.data = d;
 }
コード例 #27
0
ファイル: Client.cs プロジェクト: Wroud/MCSClasic
 public Client(TcpClientm Net)
 {
     this.Net = Net;
 }
コード例 #28
0
 public Packet202PlayerAbilities(TcpClientm d)
 {
     this.data = d;
 }
コード例 #29
0
 public static void Read(TcpClientm d)
 {
     byte[] s = ReadBytes(d);
     byte[] v = ReadBytes(d);
     d.cli.onSharedKey(s, v);
 }
コード例 #30
0
 public static void Read(TcpClientm d)
 {
 }