الموضوع: System GameUpdates
عرض مشاركة واحدة
احصائياتى

الردود
2

المشاهدات
3903
تفاعلات العضو
 
QR تعريفي
QR Code
محمد ياسر

محمد ياسر is on a distinguished road

    غير متواجد

المشاركات
1,940

+التقييم
0.71

تاريخ التسجيل
Apr 2019

الاقامة
https://www.facebook.com/daany

نظام التشغيل

رقم العضوية
1
2019-04-23, 02:17 PM
المشاركة 1 
#1  
افتراضي System GameUpdates

ده سستم الي اول ما الاعب يفتح اللعبه يلاقي رساله رزقه
بتقوله في تحديث في اللعبه وده كلام انت الي اتكتبه براحتك

كود:
Network 

ۈآڤـﭥﺢـ ڤـۈلْـﮈړ


كود:
 GamePackets 

اٌعٍمِـلِـ كُلِـاٌسُ جِدّيٌـدّ بّــ اٌسُمِـ ,

كود:
GameUpdates 

ﺿﯾﭬ ﭴۆاھَہّ ﮃا


كود:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 

namespace 
LordsRoad.Network.GamePackets 
{ 
public class 
GameUpdates : Writer, Interfaces.IPacket 
{ 
private 
byte[] Buffer; 

public const 
byte 
Header 
= 0, 
Body = 1, 
Footer = 2; 

public 
GameUpdates(byte _Type, string _String) 
{ 
this.Buffer = new byte[29 + _String.Length]; 
WriteUInt16((ushort)(Buffer.Length - Cool, 0, Buffer); 
WriteUInt16(2032, 2, Buffer); 
WriteUInt32((uint)Time32.timeGetTime().GetHashCode(), 4, Buffer); 
Buffer[15] = 112; 
Buffer[16] = 1; 
Type = _Type; 
_string = _String; 
} 

public 
byte Type 
{ 
get { return Buffer[14]; } 
set { Buffer[14] = value; } 
} 

public 
string _string 
{ 
get { return System.BitConverter.ToString(Buffer, 18, Buffer[17]); } 
set { WriteStringWithLength(value, 17, Buffer); } 
} 
public 
void Send(Client.GameClient client) 
{ 
client.Send(Buffer); 
} 
public 
void Deserialize(byte[] buffer) 
{ 
this.Buffer = buffer; 
} 

public 
byte[] ToArray() 
{ 
return 
Buffer; 
} 
} 
} 

خًشْ عٍ كُلِـاٌسُ

كود:
PacketHandler.cs 

ﯚﺂ̣̥̐ﺑـﺣﺜ ﻋﻧـ ,


كود:
static void AppendConnect(Connect appendConnect, Client.GameClient client) 

آقٍّفٍّلِّهِّ مِّـنِّ آلِّسَّآلِّبٍّ وٍّحَّطِّ تٍّحَّتٍّيِّهِّ دٍّهِّ ,


كود:
 private static void HeaderUpdates(string update, GameClient client) 
{ 
client.Send(new GameUpdates(GameUpdates.Header, update)); 
} 
private static 
void BodyUpdates(string update, GameClient client) 
{ 
client.Send(new GameUpdates(GameUpdates.Body, update)); 
} 
private static 
void FooterUpdates(string update, GameClient client) 
{ 
client.Send(new GameUpdates(GameUpdates.Footer, update)); 
} 

خـشًـ ﻋ ڤـۈلْـﮈړ

كود:
System 

آعَمـَلَ ﻛَلَآسُ جَدِيْدِ بِـ آسُمـَ ,


كود:
GameUpdetess 

ﺿﯾﭬ ﭴۆاھَہّ ﮃا

كود:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 

namespace 
TroZenA.Database 
{ 
internal class GameUpdetess 
{ 
public static 
string Header = ""; 
public static 
string Body1 = ""; 
public static 
string Body2 = ""; 
public static 
string Body3 = ""; 
public static 
string Body4 = ""; 
public static 
string Body5 = ""; 
public static 
string Body6 = ""; 
public static 
string Date = ""; 


public static 
void LoadRates() 
{ 
MySqlReader reader = new MySqlReader(new MySqlCommand(MySqlCommandType.SELECT).Select("gameupdates")); 
if (
reader.Read()) 
{ 
Header = reader.ReadString("Header"); 
Body1 = reader.ReadString("Body1"); 
Body2 = reader.ReadString("Body2"); 
Body3 = reader.ReadString("Body3"); 
Body4 = reader.ReadString("Body4"); 
Body5 = reader.ReadString("Body5"); 
Body6 = reader.ReadString("Body6"); 
// Body6 = reader.ReadString("Date"); 


} 
Console.WriteLine("System GameUpdates Loaded."); 

} 
} 
} 

رًّوّحّْ عَّلَّيٌّ كّْلَّاٍّسًّ

كود:
 Writer 

ابحث عن ,

كود:
public class Writer 
{ 

تحت القوس عـ طول ضيف ,

كود:
public static void WriteStringWithLength(string arg, int offset, byte[] buffer) 
{ 
if (
buffer == null) 
return; 
if (
offset > buffer.Length - 1) 
return; 
int till = buffer.Length - offset; 
till = Math.Min(arg.Length, till); 
buffer[offset] = (byte)arg.Length; 
offset++; 
byte[] argEncoded = Program.Encoding.GetBytes(arg); 
Array.
Copy(argEncoded, 0, buffer, offset, till); 
} 

خش ع كلاس

كود:
PacketHandler.cs 

ابحث عن ,

كود:
client.UnionExploits = client.UnionExploits; 

هتلاقي تحتيه ,

كود:
client.LoadItemStats(); 

تحتيها عـ طول ضيف ,

كود:
#region Game Updates 

{ 
HeaderUpdates("Welcome All in Server" + DateTime.Now.ToString(), client); 
BodyUpdates("The Server Has Hard Drops 200 Cps Randomn ", client); 
BodyUpdates("All New Characters And System Is Here ! Smile", client); 
BodyUpdates("Guild War Start Eevry Friday At [20:00] End Every At [24:00]", client); 
BodyUpdates("Any One Need Any Help", client); 
FooterUpdates("Enjoy With Us in Server! Smile", client); 
} 

#endregion 

لو عايز تعدل ع الرسائل عدل عليها من هنا

كود:
#region Game Updates 

{ 
HeaderUpdates("Welcome All in Server" + DateTime.Now.ToString(), client); 
BodyUpdates("The Server Has Hard Drops 200 Cps Randomn ", client); 
BodyUpdates("All New Characters And System Is Here ! Smile", client); 
BodyUpdates("Guild War Start Eevry Friday At [20:00] End Every At [24:00]", client); 
BodyUpdates("Any One Need Any Help", client); 
FooterUpdates("Enjoy With Us in Server! Smile", client); 
} 

#endregion