public Packet253Auth(TcpClientm data,string s, byte[] k, byte[] t) { this.data = data; this.sid = s; this.key = k; this.token = t; }
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); }
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); }
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; }
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); }
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]; }
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); }
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; }
public static void WriteBytes(TcpClientm d, byte[] b) { if (b != null) { d.Write((short)b.Length); d.Write(b); } else d.Write((short)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); }
public Packet252SharedKey(TcpClientm d, byte[] s, byte[] v) { this.data = d; this.sharedSecret = s; this.verifyToken = v; }
public static byte[] ReadBytes(TcpClientm d) { short lenght = d.NetStream.ReadInt16(d); return d.NetStream.ReadBytes(d, lenght); }
public static byte[] ReadBytes(this NetworkStream reader, TcpClientm tc, int count) { byte[] b = new byte[count]; reader.Read(b, 0, count); return b; }
public static string ReadString(this NetworkStream reader, TcpClientm tc) { return new string(UnicodeEncoding.ASCII.GetChars(reader.ReadBytes(tc, 64))).TrimEnd(); }
public Packet255Kick(TcpClientm d,string mes) { this.data = d; this.messag = mes; }
public Packet0KeepAlive(TcpClientm d,int r) { this.data = d; this.rand = r; }
public Packet0KeepAlive(TcpClientm data) { this.data = data; }
public static Packet Read(TcpClientm d) { return null; }
public static void Read(TcpClientm d) { int r = d.NetStream.ReadInt32(d); //return new Packet0KeepAlive(d,r); }
public Packet253Auth(TcpClientm data) { this.data = data; }
public static byte ReadByte(this NetworkStream reader, TcpClientm tc) { byte[] b = new byte[1]; reader.Read(b, 0, 1); return b[0]; }
public static void WriteString(TcpClientm d, string s) { d.Write((short)s.Length); if (s.Length > 0) d.Write(s); }
public Packet252SharedKey(TcpClientm data) { this.data = data; }
public Packet1Login(TcpClientm d) { this.data = d; }
public static void Read(TcpClientm d) { string s = ReadString(d, 20); byte[] sd = ReadBytes(d); }
public Packet250CustomPayload(TcpClientm d) { this.data = d; }
public Client(TcpClientm Net) { this.Net = Net; }
public Packet202PlayerAbilities(TcpClientm d) { this.data = d; }
public static void Read(TcpClientm d) { byte[] s = ReadBytes(d); byte[] v = ReadBytes(d); d.cli.onSharedKey(s, v); }
public static void Read(TcpClientm d) { }