public static void ClientCheck2(Definitions.Clientdefinition sys) { PacketWriter Writer = new PacketWriter(); Writer.Create (0x2005); Writer.Byte(1); Writer.Byte(0); Writer.Byte(1); Writer.Byte(0x47); Writer.Byte(1); Writer.Byte(5); Writer.Byte(0); Writer.Byte(0); Writer.Byte(0); Writer.Byte(2); sys.client.Send(Writer.GetBytes()); Writer = new PacketWriter(); Writer.Create(0x6005); Writer.Byte(3); Writer.Byte(0); Writer.Byte(2); Writer.Byte(0); Writer.Byte(2); sys.client.Send(Writer.GetBytes()); Writer = new PacketWriter(); Writer.Create(0xA100); Writer.Byte(1); Writer.Byte(0); sys.client.Send(Writer.GetBytes()); }
public static byte[] PrivateMessageCheck(WorldMgr.character c) { DB ms = new DB("SELECT * FROM message WHERE receiver='" + c.Information.Name + "'"); PacketWriter Writer = new PacketWriter(); int count = ms.Count(); Writer.Create(OperationCode.SERVER_PM_MESSAGE); Writer.Byte(1);//Static Writer.Byte(Convert.ToByte(count));//Total count using (System.Data.SqlClient.SqlDataReader reader = ms.Read()) { while (reader.Read()) { string pmfrom = reader.GetString(1); string pmto = reader.GetString(2); string pmmessage = reader.GetString(3); byte pmstatus = reader.GetByte(4); DateTime pmdate = Convert.ToDateTime(reader.GetDateTime(5)); Writer.Text(pmfrom); // Message From Writer.DWord(0x8A070000); // date Writer.DWord(0xC7058401); // date Writer.Byte(pmstatus); // Status (0 = Unread) (1 = Read) } ms.Close(); } return Writer.GetBytes(); }
public static byte[] InfoUpdate(byte type, int obje, byte bT) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_INFO_UPDATE); Writer.Byte(type); switch (type) { case 1: Writer.LWord(obje); Writer.Byte(0); break; case 2: Writer.DWord(obje); Writer.Byte(0); break; case 4: Writer.Byte(bT); Writer.DWord(obje); break; default: break; } return Writer.GetBytes(); }
public static byte[] NewsPacket() { PacketWriter Writer = new PacketWriter(); Writer.Create(Opcodes.SERVER.SERVER_MAIN); Writer.Byte(0); Writer.Byte((byte)Definitions.Serverdef.News_List.Count); foreach (Definitions.Serverdef.NewsList n in Definitions.Serverdef.News_List) { Writer.Text(n.Title); Writer.Text(n.Article); Writer.Word(n.Year); Writer.Word(n.Month); Writer.Word(n.Day); Writer.Word(0); // Hour Writer.Word(0); // Minute Writer.Word(0); // Second Writer.Word(0); // MiliSecond } Writer.Word(0); return Writer.GetBytes(); }
public static byte[] ServerListPacket(int cliVersion) { //Create a new packet writer to create our packet PacketWriter W = new PacketWriter(); //Write the opcode from server to client W.Create(Opcodes.SERVER.SERVER_SERVERLIST); //Structure of packet below W.Word(0x0201); W.Text("CLOWEN_DEV_PROJECT"); W.Byte(0); //Repeat the following packet data below for each server in the list foreach (KeyValuePair<int, Definitions.Serverdef.ServerDetails> Gameservers in Definitions.Serverdef.Serverlist) { if (cliVersion == Definitions.Serverdef.SilkroadClientVersion) { W.Bool(true); W.Word(Gameservers.Value.id); W.Text(Gameservers.Value.name); W.Word(Gameservers.Value.usedSlots); W.Word(Gameservers.Value.maxSlots); W.Byte(Gameservers.Value.status); } } //Static 0 byte W.Byte(0); //Send the created packet back to the request (client). return W.GetBytes(); }
public static byte[] FriendData(int target, byte type, string name, WorldMgr.character c, bool state) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_FRIEND_DATA); switch (type) { case 2: //Friend invite accepted Writer.Byte(2); Writer.DWord(target); //Id Writer.Text(c.Information.Name); //Name Writer.DWord(c.Information.Model); //Model break; case 3: //Remove friend from own list Writer.Byte(3); Writer.DWord(target); break; case 4: //Fried online / offline update Writer.Byte(4); Writer.DWord(target); Writer.Byte(state); break; case 5: //Send private message.. Writer.Byte(8); Writer.Text(name); Writer.DWord(0); Writer.DWord(0);//time info break; } return Writer.GetBytes(); }
public static byte[] FriendGroupManage(string type,string groupname, short groupid, int targetid) { PacketWriter Writer = new PacketWriter(); switch (type) { case "ADD": Writer.Create(OperationCode.SERVER_FRIEND_GROUP); Writer.Byte(1); Writer.Text(groupname); Writer.Word(groupid); break; case "REMOVE": Writer.Create(OperationCode.SERVER_FRIEND_GROUP_REMOVE); Writer.Byte(1); Writer.Word(groupid); break; case "MOVE": Writer.Create(OperationCode.SERVER_FRIEND_GROUP_MANAGE_FRIEND); Writer.Byte(1); Writer.DWord(targetid); Writer.Word(groupid); break; } return Writer.GetBytes(); }
/////////////////////////////////////////////////////////////////////////// // Despawn Pet /////////////////////////////////////////////////////////////////////////// public static byte[] PetSpawn(int petid, byte type, CLGameServer.WorldMgr.pet_obj o) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_PLAYER_SPAWN_PET); //Select Opcode Writer.DWord(petid); //Pet ID switch (type) { case 1: //Despawn pet Writer.Byte(1); break; case 2: //Rename pet respawn Writer.Byte(5); Writer.Text(o.Petname); break; case 3: //Attack pet respawn for exp info Writer.Byte(3);//Static Writer.LWord(o.exp);//New exp Writer.DWord(o.OwnerID);//Owner id break; } return Writer.GetBytes(); }
public static byte[] CreateFormedParty(WorldMgr.party pt) { //Create new packet writer PacketWriter Writer = new PacketWriter(); //Add opcode to packet Writer.Create(OperationCode.SERVER_FORMED_PARTY_CREATED); //Static byte Writer.Byte(1); //Party id Writer.DWord(pt.ptid); //0 Dword value Writer.DWord(0); //Party type Writer.Byte(pt.Type); //Party purpose Writer.Byte(pt.ptpurpose); //Party min level required Writer.Byte(pt.minlevel); //Party max level allowed Writer.Byte(pt.maxlevel); //Party name Writer.Text3(pt.partyname); //Return all bytes to send return Writer.GetBytes(); }
public static byte[] ClientIsToOld() { PacketWriter Writer = new PacketWriter(); Writer.Create(0xA100); Writer.Byte(2); Writer.Byte(5); return Writer.GetBytes(); }
public static byte[] ClientIsToNew() { PacketWriter Writer = new PacketWriter(); Writer.Create(Opcodes.SERVER.SERVER_MAIN); Writer.Byte(2); Writer.Byte(1); return Writer.GetBytes(); }
// need research public static byte[] ServerIsFull() { PacketWriter Writer = new PacketWriter(); Writer.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE); Writer.Byte(0x02); Writer.Byte(0x05); return Writer.GetBytes(); }
public static byte[] AlchemyCancel() { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_ALCHEMY); Writer.Byte(1); Writer.Byte(1); return Writer.GetBytes(); }
public static byte[] AddInventorySlots(object SlotCount, byte Unknow = 1) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_ADD_INVENTORY_SLOT); Writer.Byte(Unknow); Writer.Byte(SlotCount); return Writer.GetBytes(); }
public static byte[] DeletePrivateMessage(byte messageid) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_PM_DELETE); Writer.Byte(0x01); Writer.Byte(messageid); return Writer.GetBytes(); }
public static byte[] FORTRESSNOTE() { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_FORTRESS_NOTIFY); Writer.Byte(0); Writer.Byte(0); return Writer.GetBytes(); }
public static byte[] StallBuyItem(byte stallslot, short amount) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_STALL_BUY); Writer.Byte(amount); Writer.Byte(stallslot); return Writer.GetBytes(); }
public static byte[] AllreadyConnected() { PacketWriter Writer = new PacketWriter(); Writer.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE); Writer.Byte(0x02); Writer.Byte(0x03); return Writer.GetBytes(); }
public static byte[] Exchange_Cancel() { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_EXCHANGE_CANCEL); Writer.Byte(0x2C); Writer.Byte(0x18); return Writer.GetBytes(); }
public static byte[] TeleportImage(byte xsec, byte ysec) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_TELEPORTIMAGE); Writer.Byte(xsec); Writer.Byte(ysec); return Writer.GetBytes(); }
public static byte[] ActionState(byte b1, byte b2) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_ACTIONSTATE); Writer.Byte(b1); Writer.Byte(b2); return Writer.GetBytes(); }
public static byte[] ChatIndexPacket(byte type, byte index) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_CHAT_INDEX); Writer.Bool(true); Writer.Byte(type); Writer.Byte(index); return Writer.GetBytes(); }
public static byte[] PrivateMessageOpen(byte type, string Messageinfo) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_PM_OPEN); Writer.Byte(0x01); Writer.Byte(type); Writer.Text(Messageinfo); return Writer.GetBytes(); }
public static byte[] StartingLeaveGame(byte time, byte type) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_LEAVE_ACCEPT); Writer.Byte(1); Writer.DWord(time); Writer.Byte(type); return Writer.GetBytes(); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////// // Change item quantity //////////////////////////////////////////////////////////////////////////////////////////////////////////// public static byte[] ChangeItemQ(byte tslot, int itemid) { PacketWriter writer = new PacketWriter(); writer.Create(OperationCode.SERVER_ITEM_QUANTITY_UPDATE); writer.Byte(tslot); writer.Byte(1); writer.DWord(itemid); return writer.GetBytes(); }
public static byte[] Messages2(ushort opcode, ushort id) { PacketWriter Writer = new PacketWriter(); Writer.Create(opcode); Writer.Byte(3); Writer.Byte(0); Writer.Word(id); return Writer.GetBytes(); }
public static byte[] ActionPacket(byte type1, byte type2) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_ACTION_DATA); Writer.Byte(type1); Writer.Byte(type2); Writer.Byte(0x30); return Writer.GetBytes(); }
public static byte[] MakeAliasError(string name, byte switchinfo) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_MAKE_ALIAS); Writer.Byte(2); Writer.Word(0); Writer.Byte(0); Writer.Text(name); return Writer.GetBytes(); }
public static byte[] Player_UpToHorse(int ownerID, bool type, int petID) { PacketWriter Writer = new PacketWriter(); Writer.Create(OperationCode.SERVER_PLAYER_UPTOHORSE); //Select opcode Writer.Byte(1); //Static byte Writer.DWord(ownerID); //Horse Owner ID Writer.Byte(type); //Horse Type Writer.DWord(petID); //Horse ID return Writer.GetBytes(); }
public static byte[] PasswordFailed(int CurrentAttempts, int MaxAttempts) { PacketWriter Write = new PacketWriter(); Write.Create(Opcodes.SERVER.SERVER_GATEWAY_LOGIN_RESPONSE); Write.Byte(2); Write.Byte(1); Write.DWord(MaxAttempts); Write.DWord(CurrentAttempts); return Write.GetBytes(); }