public override ServerProtocol DecodeSrv(Octets os) { CompactUInt type = new CompactUInt(os); if (type > 0x3FFF) { throw new NotSupportedException(); } CompactUInt size = new CompactUInt(os); if (size + os.Position > os.Length) { throw new ProtocolSizeExceedException(); } os.Undo(); switch (type.Value) { case 0x02: return(new S02SMKey(os, this)); case 0x04: return(new S04OnlineAnnounce(os, this)); case 0x47: return(new S47SelectRole_Re(os, this)); default: return(new ServerProtocol(type, os, this)); } }
public Protocol(CompactUInt type, Octets os) : base() { this.Type = type; this.Len = os.ReadCompactUInt(); if (!SizePolicy()) { throw new NotSupportedException("Err: size policy wrong, size = " + this.Len); } os.Undo(); Write(os.ReadOctets().RawData()); Unmarshal(); }
public override ServerProtocol DecodeSrv(Octets os) { CompactUInt type = new CompactUInt(os); if (type > 0x3FFF) { throw new NotSupportedException(); } CompactUInt size = new CompactUInt(os); if (size + os.Position > os.Length) { throw new ProtocolSizeExceedException(); } os.Undo(); switch (type.Value) { case 0x45: return(new D45PlayerLogout(os, this)); case 0xEF: return(new DEFUpdateEnemyList_Re(os, this)); case 0xF1: return(new DF1GetEnemyList_Re(os, this)); case 0x14ED: return(new D14EDHomeBrief(os, this)); case 0x14EE: return(new D14EEHomeDetail(os, this)); case 0x1502: return(new D1502HomeSyncNoticeClient(os, this)); case 0x150A: return(new D150AHomeFoundryFormulasSync(os, this)); case 0x1516: return(new D1516HomeVisitorInfo(os, this)); case 0x1521: return(new D1521HomeEditRes(os, this)); case 0x1522: return(new D1522HomeBrowseInfoQuery_Re(os, this)); default: return(new ServerProtocol(type, os, this)); } }
public override ClientProtocol DecodeCli(Octets os) { CompactUInt type = new CompactUInt(os); if (type > 0x3FFF) { throw new NotSupportedException(); } CompactUInt size = new CompactUInt(os); if (size + os.Position > os.Length) { throw new ProtocolSizeExceedException(); } os.Undo(); switch (type.Value) { case 0x02: return(new C02CMKey(os, this)); case 0x03: return(new C03LogginAnnounce(os, this)); case 0x46: return(new C46SelectRole(os, this)); case 0xF0: return(new CF0GetEnemyList(os, this)); case 0x14EC: return(new C14ECHomeQuery(os, this)); case 0x14F1: return(new C14F1EditHomeEnd(os, this)); case 0x1510: return(new C1510HomeFoundryQuery(os, this)); case 0x1515: return(new C1515HomeVisitorQuery(os, this)); case 0x1517: return(new C1517HomeBrowseInfoQuery(os, this)); default: return(new ClientProtocol(type, os, this)); } }
public override ServerProtocol DecodeSrv(Octets os) { CompactUInt type = new CompactUInt(os); if (type > 0x3FFF) { throw new NotSupportedException(); } CompactUInt size = new CompactUInt(os); if (size + os.Position > os.Length) { throw new ProtocolSizeExceedException(); } os.Undo(); switch (type.Value) { default: return(new ServerProtocol(type, os, this)); } }
public override ClientProtocol DecodeCli(Octets os) { CompactUInt type = new CompactUInt(os); if (type > 0x3FFF) { throw new NotSupportedException(); } CompactUInt size = new CompactUInt(os); if (size + os.Position > os.Length) { throw new ProtocolSizeExceedException(); } os.Undo(); switch (type.Value) { case 0x52: return(new L52RoleList(os, this)); default: return(new ClientProtocol(type, os, this)); } }
public ServerProtocol(CompactUInt type, Octets os, Proxy session) : base(type, os) { this.Session = session; }
public ServerProtocol(CompactUInt type) : base(type) { }
public Protocol(CompactUInt type) : base() { this.Type = type; this.Incomplete = false; }
public ClientProtocol(CompactUInt type) : base(type) { }