السلام عليكم ورحمة الله وبركاته
اليوم اضافة ملفات البوكر كله
يلا نبداء
علشان منكبرش الموضوع انشرح بالصور
ده ملفات اتتحط في فلدر Game
والملفات دي هتتحط في المسار دا
Network\GamePackets
وأخيرآ تحميل الملفات ونحطها فى الـ bin
في مسار bin\debug\database\gmlogs
ضيف الملفات دى فى السورس
نيجي شوية للاكواد
كلاس Program.cs
ضيف دول
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
public static void AddpokerCps(string text) { try { text = "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + text; string str = DateTime.Now.Year + "-" + DateTime.Now.Month; string str2 = @"gmlogs\AddpokerCps"; string str3 = Path.Combine(str2, str); if (!File.Exists(str3 + str)) { Directory.CreateDirectory(Path.Combine(str2, str)); } if (!File.Exists(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { using (FileStream stream = File.Create(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { stream.Close(); } } using (StreamWriter writer = new StreamWriter(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }), true)) { writer.WriteLine(text); writer.Close(); } } catch (Exception exception) { Phoenix_Project.Console.WriteLine(exception, ConsoleColor.DarkYellow); } } public static void AddpokerAllinCps(string text) { try { text = "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + text; string str = DateTime.Now.Year + "-" + DateTime.Now.Month; string str2 = @"gmlogs\AddpokerAllinCps"; string str3 = Path.Combine(str2, str); if (!File.Exists(str3 + str)) { Directory.CreateDirectory(Path.Combine(str2, str)); } if (!File.Exists(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { using (FileStream stream = File.Create(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { stream.Close(); } } using (StreamWriter writer = new StreamWriter(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }), true)) { writer.WriteLine(text); writer.Close(); } } catch (Exception exception) { Phoenix_Project.Console.WriteLine(exception, ConsoleColor.DarkYellow); } } public static void AddCpsWin(string text) { try { text = "[" + DateTime.Now.ToString("HH:mm:ss") + "]" + text; string str = DateTime.Now.Year + "-" + DateTime.Now.Month; string str2 = @"gmlogs\AddWinCps"; string str3 = Path.Combine(str2, str); if (!File.Exists(str3 + str)) { Directory.CreateDirectory(Path.Combine(str2, str)); } if (!File.Exists(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { using (FileStream stream = File.Create(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }))) { stream.Close(); } } using (StreamWriter writer = new StreamWriter(string.Concat(new object[] { str3, @"", DateTime.Now.Day, ".txt" }), true)) { writer.WriteLine(text); writer.Close(); } } catch (Exception exception) { ZenonProJect.Console.WriteLine(exception, ConsoleColor.DarkYellow); } } |
كلاس PacketBuilder.cs في Game
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
namespace Phoenix_Project.Game { using System; using Phoenix_Project; public class PacketBuilder { protected byte[] _buffer = new byte[0x400]; protected int Len; protected int Position; protected byte[] TQ_SERVER = Program.Encoding.GetBytes("TQServer"); public PacketBuilder(int T, int L) { this.Len = L; this.Length(L); this.Type(T); } internal void Fill(int End) { for (int i = this.Position; i < End; i++) { this.Int(0); } } public byte[] getFinal() { this.Seal(); return this._buffer; } public int GetPos() => this.Position; public void Int(int value) { this._buffer[this.Position] = Convert.ToByte((int) (value & 0xff)); this.Position++; } public void Int(uint value) { this._buffer[this.Position] = Convert.ToByte((uint) (value & 0xff)); this.Position++; } public void Int(int value, int Offset) { this._buffer[Offset] = Convert.ToByte((int) (value & 0xff)); Offset++; } public void Int(uint value, int Offset) { this._buffer[Offset] = Convert.ToByte((uint) (value & 0xff)); Offset++; } public void Length(int value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; } public void Length(int value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> & 0xff); } public void Long(int value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x10) & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x18) & 0xff); this.Position++; } public void Long(uint value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x10) & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x18) & 0xff); this.Position++; } public void Long(ulong value) { this._buffer[this.Position] = (byte) (value & ((ulong) 0xffL)); this.Position++; this._buffer[this.Position] = (byte) ((value >> & ((ulong) 0xffL)); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x10) & ((ulong) 0xffL)); this.Position++; this._buffer[this.Position] = (byte) ((value >> 0x18) & ((ulong) 0xffL)); this.Position++; } public void Long(int value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> 0x10) & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> 0x18) & 0xff); } public void Long(uint value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> 0x10) & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> 0x18) & 0xff); Offset++; } public void Long(ulong value, int Offset) { this._buffer[Offset] = (byte) (value & ((ulong) 0xffL)); Offset++; this._buffer[Offset] = (byte) ((value >> & ((ulong) 0xffL)); Offset++; this._buffer[Offset] = (byte) ((value >> 0x10) & ((ulong) 0xffL)); Offset++; this._buffer[Offset] = (byte) ((value >> 0x18) & ((ulong) 0xffL)); } public void Move(int value) { for (int i = 0; i < value; i++) { this._buffer[this.Position] = 0; this.Position++; } } internal void PrintThis() { string line = ""; for (int i = 0; i < this.Position; i++) { line = line + this._buffer[i].ToString("X") + " "; } Phoenix_Project.Console.WriteLine(line, ConsoleColor.DarkYellow); } protected void Seal() { Array.Copy(this.TQ_SERVER, 0, this._buffer, this.Position, this.TQ_SERVER.Length); this.Position += this.TQ_SERVER.Length + 1; byte[] destinationArray = new byte[this.Position - 1]; Array.Copy(this._buffer, destinationArray, (int) (this.Position - 1)); this._buffer = new byte[destinationArray.Length]; Array.Copy(destinationArray, this._buffer, destinationArray.Length); destinationArray = null; } public void SetPosition(int Pos) { this.Position = Pos; } public void Short(int value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; } public void Short(uint value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; } public void Short(int value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); this._buffer[Offset + 1] = (byte) ((value >> & 0xff); } public void Short(uint value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> & 0xff); } public void Text(string value) { byte[] bytes = Program.Encoding.GetBytes(value); Array.Copy(bytes, 0, this._buffer, this.Position, bytes.Length); this.Position += bytes.Length; } public void Type(int value) { this._buffer[this.Position] = (byte) (value & 0xff); this.Position++; this._buffer[this.Position] = (byte) ((value >> & 0xff); this.Position++; } public void Type(int value, int Offset) { this._buffer[Offset] = (byte) (value & 0xff); Offset++; this._buffer[Offset] = (byte) ((value >> & 0xff); } public void ULong(ulong value) { this._buffer[this.Position] = (byte) value; this.Position++; this._buffer[this.Position] = (byte) (value >> 8); this.Position++; this._buffer[this.Position] = (byte) (value >> 0x10); this.Position++; this._buffer[this.Position] = (byte) (value >> 0x18); this.Position++; this._buffer[this.Position] = (byte) (value >> 0x20); this.Position++; this._buffer[this.Position] = (byte) (value >> 40); this.Position++; this._buffer[this.Position] = (byte) (value >> 0x30); this.Position++; this._buffer[this.Position] = (byte) (value >> 0x38); this.Position++; } public void ULong(ulong value, int Offset) { this._buffer[Offset] = (byte) value; Offset++; this._buffer[Offset] = (byte) (value >> 8); Offset++; this._buffer[Offset] = (byte) (value >> 0x10); Offset++; this._buffer[Offset] = (byte) (value >> 0x18); Offset++; this._buffer[Offset] = (byte) (value >> 0x20); Offset++; this._buffer[Offset] = (byte) (value >> 40); Offset++; this._buffer[Offset] = (byte) (value >> 0x30); Offset++; this._buffer[Offset] = (byte) (value >> 0x38); } } } |