public addUint16 ( |
||
value | ||
reversed | int | |
return | void |
public void SendWhoCMD(WorldClient client) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_CHAT_WHO_RESPONSE, 0); pak.addUint16(5, 1); // Alsways there pak.addByte(0x00); // We are not sure why but as its just 3 bytes for the nums we need "space" bytes pak.addUint16((UInt16)WorldSocket.Clients.Count, 1); pak.addByte(0x00); // Again there is space foreach (string clientKey in WorldSocket.Clients.Keys) { WorldClient theClient = WorldSocket.Clients[clientKey] as WorldClient; // ToDo: this is not complete implemented - the first is maybe an offset- needs more research firstex pak.addHexBytes("3c014801"); // This is just from logs pak.addByte(0xef); // profession pak.addHexBytes("010000"); pak.addByteArray(theClient.playerInstance.Level.getValue()); pak.addByte(0x01); pak.addByte(0x00); } foreach (string clientKey in WorldSocket.Clients.Keys) { WorldClient theClient = WorldSocket.Clients[clientKey] as WorldClient; // ToDo: this is really dirty hacky string charname = StringUtils.charBytesToString_NZ(theClient.playerInstance.CharacterName.getValue()); pak.addSizedTerminatedString(charname); } Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendMarketPlaceList(WorldClient client) { // ToDo: make it dynamic with database later (but the "handler" should give the items as arguments for this method // List Marketplace Items byte[] headerSeperator = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Should foreach this later on "Real Server" DynamicArray listItems = new DynamicArray(); listItems.append(StringUtils.hexStringToBytes("8703000000000034bdcf1200401f00000310db6a4a")); // Foot Wear listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd012000000FFFF01aedc6a4a")); // Google listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("721a000003a04a000bd012000000FFFF01aedc6a4a")); // Item Data listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd01200000000FF01aedc6a4a")); // Item Data listItems.append(0x00); // Seperate each item // get data size byte[] itemSize = NumericalUtils.uint16ToByteArray((UInt16)listItems.getBytes().Length, 1); PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOAD_MARKERPLACE, 0); pak.addUintShort(9); // list offset pak.addByteArray(headerSeperator); pak.addUint16((UInt16)listItems.getBytes().Length,1); pak.addByteArray(listItems.getBytes()); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendMarketPlaceList(WorldClient client) { // ToDo: make it dynamic with database later (but the "handler" should give the items as arguments for this method // List Marketplace Items byte[] headerSeperator = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Should foreach this later on "Real Server" DynamicArray listItems = new DynamicArray(); listItems.append(StringUtils.hexStringToBytes("8703000000000034bdcf1200401f00000310db6a4a")); // Foot Wear listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd012000000FFFF01aedc6a4a")); // Google listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("721a000003a04a000bd012000000FFFF01aedc6a4a")); // Item Data listItems.append(0x00); // Seperate each item listItems.append(StringUtils.hexStringToBytes("2e00000003a04a000bd01200000000FF01aedc6a4a")); // Item Data listItems.append(0x00); // Seperate each item // get data size byte[] itemSize = NumericalUtils.uint16ToByteArray((UInt16)listItems.getBytes().Length, 1); PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOAD_MARKERPLACE, 0); pak.addUintShort(9); // list offset pak.addByteArray(headerSeperator); pak.addUint16((UInt16)listItems.getBytes().Length, 1); pak.addByteArray(listItems.getBytes()); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void testCloseCombat(ref byte[] packet) { byte[] targetViewWithSpawnId = new byte[4]; ArrayUtils.copy(packet, 0, targetViewWithSpawnId, 0, 4); string hexString = StringUtils.bytesToString_NS(targetViewWithSpawnId); string hexStringPak = StringUtils.bytesToString_NS(packet); Store.currentClient.messageQueue.addObjectMessage(StringUtils.hexStringToBytes("020003010C00808400808080800100001000"), false); // Make me combat mode "on" // The 55 View Packet PacketContent ilCombatHandler = new PacketContent(); ilCombatHandler.addHexBytes("01000C370036CDAB0205"); ilCombatHandler.addByteArray(Store.currentClient.playerInstance.Position.getValue()); ilCombatHandler.addHexBytes("cdec4023"); // Time starts i think ilCombatHandler.addHexBytes("fd0000"); // view ID fd00 Store.currentClient.messageQueue.addObjectMessage(ilCombatHandler.returnFinalPacket(), false); Store.currentClient.flushQueue(); // The other 03 Packet for combat PacketContent unknownCreatePak = new PacketContent(); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("010002A700")); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("FD00")); // ViewID from Combat Object unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01")); unknownCreatePak.addByteArray(Store.currentClient.playerInstance.Position.getValue()); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("0100000003000000")); unknownCreatePak.addByteArray(targetViewWithSpawnId); unknownCreatePak.addUint16(2, 1); unknownCreatePak.addUint16(Store.currentClient.playerData.selfSpawnIdCounter, 1); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01010207030000200BF5C2000020C19420B9C300000000000020C100000000070001001201000007037608E00603145200008B0B0024145200008B0B0024882300008B0B00240000000000000000000000000000000064000000640000000010001010000000020000001000000002000000000000000000000000")); Store.currentClient.messageQueue.addObjectMessage(unknownCreatePak.returnFinalPacket(), false); Store.currentClient.flushQueue(); }
public void spawnDataNodeView(WorldClient client) { // ToDo: implement it in our Object Attribute Generation System // #VALUES FOR GOID: 47080, DataNodeContainer // #USING 305, Binary-Present: YES // 276,Position,LTVector3d,24 // 140,HalfExtents,LTVector3f,12 // 194,MissionKey,MissionKey,4 // 304,UseCount,uint8,1 // 108,CurrentState,EventID,4 // 112,CurrentTimerState,EventID,4 // 260,Orientation,LTQuaternion,16 WorldSocket.entityIdCounter++; ClientView view = client.viewMan.getViewForEntityAndGo(WorldSocket.entityIdCounter, 47080); PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addHexBytes("0ce8b7f5cdab0329"); pak.addByteArray(client.playerInstance.Position.getValue()); pak.addUintShort(1); // UseCount pak.addUint32(4001, 1); // 112,CurrentTimerState,EventID,4 pak.addUint16(view.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); }
public void processLoadAbility(ref byte[] packet) { // read the values from the packet PacketReader reader = new PacketReader(packet); UInt32 staticObjectID = reader.readUInt32(1); UInt16 unloadFlag = reader.readUInt16(1); UInt16 loadFlag = reader.readUInt16(1); UInt16 countAbilities = reader.readUInt16(1); int pointer = 11; // Start at index 11 List <UInt16> abilitySlots = new List <UInt16>(); for (int i = 1; i <= countAbilities; i++) { // This must be looped byte[] slotByteID = new byte[2]; ArrayUtils.copyTo(packet, pointer, slotByteID, 0, 2); pointer = pointer + 2; byte[] abilityByteID = new byte[2]; ArrayUtils.copyTo(packet, pointer, abilityByteID, 0, 2); pointer = pointer + 4; byte[] abilityByteLevel = new byte[2]; ArrayUtils.copyTo(packet, pointer, abilityByteLevel, 0, 2); pointer = pointer + 3; UInt16 slotID = NumericalUtils.ByteArrayToUint16(slotByteID, 1); UInt16 AbilityID = NumericalUtils.ByteArrayToUint16(abilityByteID, 1); UInt16 AbilityLevel = NumericalUtils.ByteArrayToUint16(abilityByteLevel, 1); PacketContent pak = new PacketContent(); if (unloadFlag > 0) { pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_UNLOAD, 0); pak.addByteArray(abilityByteID); } else { pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_LOAD, 0); pak.addByteArray(abilityByteID); pak.addByteArray(abilityByteLevel); pak.addByteArray(slotByteID); } abilitySlots.Add(slotID); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); } if (unloadFlag > 0) { Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 0); } else { Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 1); } }
public void sendElevatorPanel(WorldClient client, StaticWorldObject objectValues) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ELEVATOR_PANEL, 0); pak.addUint16(objectValues.sectorID, 1); pak.addHexBytes("2200"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendAttribute(WorldClient client, UInt16 attributeValue, byte type) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_PLAYER_ATTRIBUTE, 0); pak.addByte(type); pak.addUint16(attributeValue, 0); pak.addHexBytes("000802"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
// Place Methods here for Inventory public void sendInventoryItemMove(UInt16 sourceSlot, UInt16 destSlot, WorldClient client) { PacketContent pak = new PacketContent(); pak.addByte(0x65); pak.addUint16(sourceSlot,1); pak.addUint16(destSlot,1); pak.addByte(0x00); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendAttribute(WorldClient client, UInt16 attributeValue, byte type) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_PLAYER_ATTRIBUTE, 0); pak.addByte(type); pak.addUint16(attributeValue, 0); pak.addHexBytes("000802"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
// Place Methods here for Inventory public void sendInventoryItemMove(UInt16 sourceSlot, UInt16 destSlot, WorldClient client) { PacketContent pak = new PacketContent(); pak.addByte(0x65); pak.addUint16(sourceSlot, 1); pak.addUint16(destSlot, 1); pak.addByte(0x00); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
// Place Methods here for Skills public void sendCastAbilityBar(UInt16 abilityID, float timeProcessing) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_CAST_BAR_ABILITY, 0); pak.addUint16(abilityID, 1); pak.addHexBytes("00000000000000000000"); pak.addFloat(timeProcessing, 1); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendDeleteViewPacket(WorldClient client, UInt16 viewIdToDelete) { PacketContent pak = new PacketContent(); pak.addUint16(1, 1); // Master View pak.addByte(0x01); pak.addUint16(1,1); // Num Views to delete - current just this one (maybe later more) pak.addUint16(viewIdToDelete, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
// Updates the Inner Strenght Value public void sendISCurrent(WorldClient client, UInt16 innerStrengthValue) { PacketContent pak = new PacketContent(); pak.addUint16(2, 1); pak.addByte(0x02); pak.addByteArray(new byte[] { 0x80, 0x80, 0x80 }); pak.addByte(0x10); pak.addUint16(innerStrengthValue, 1); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); }
public void sendInventoryItemAdd(UInt16 freeSlot, UInt32 itemId, ushort amount, UInt16 type, WorldClient client) { PacketContent pak = new PacketContent(); pak.addByte(0x5e); pak.addUint16(freeSlot, 1); pak.addUint32(itemId, 1); pak.addUint16(0,1); pak.addUintShort(amount); pak.addUintShort(type); pak.addUintShort(1); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendMissionList(UInt16 contactId, uint orgID, WorldClient client) { /* * ToDo: check if mission team was created or not */ /* * ToDo: Figure the "unknowns" out * Examples: * Neo: 18 80 95 00 00 00 00 06 00 07 00 00 01 d0 07 00 00 31 00 00 b4 c0 0c 00 28 * Luz: 18 80 95 00 00 00 00 05 00 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 */ PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_LIST, 0); pak.addUint32(0, 0); pak.addUint16(contactId, 1); pak.addUint16(7, 1); // Unknown - in neo it has 1 pak.addUintShort(0); pak.addUintShort((ushort)orgID); pak.addHexBytes("000000000000000000000000"); // The big unknown part - maybe some informations about the contact client.messageQueue.addRpcMessage(pak.returnFinalPacket()); // ToDo: make it dynamic from a file or something ArrayList possibleMissions = new ArrayList(); possibleMissions.Add("Assassination"); possibleMissions.Add("Hack the Duality"); possibleMissions.Add("Welcome to 2015"); possibleMissions.Add("Party like '99"); UInt16 i = 0; foreach (string mission in possibleMissions) { PacketContent missionListPak = new PacketContent(); missionListPak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_NAME, 0); missionListPak.addUint16(contactId, 1); missionListPak.addUint16(i, 1); missionListPak.addHexBytes("0f0001d00700000000"); // curently unknown missionListPak.addSizedTerminatedString(mission); client.messageQueue.addRpcMessage(missionListPak.returnFinalPacket()); i++; } // And finally again a resposne PacketContent finalResponse = new PacketContent(); finalResponse.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_UNKNOWN, 0); finalResponse.addUint16(contactId, 1); client.messageQueue.addRpcMessage(finalResponse.returnFinalPacket()); }
public void spawnMobView(WorldClient client, npc thismob, ClientView mobView) { Object599 viewData = thismob.getCreationData(); PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addByteArray(Store.world.objMan.GenerateCreationPacket(viewData, 0x0000, client.playerData.assignSpawnIdCounter()).getBytes()); pak.addUint16(mobView.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public void sendInventoryItemAdd(UInt16 freeSlot, UInt32 itemId, ushort amount, UInt16 type, WorldClient client) { PacketContent pak = new PacketContent(); pak.addByte(0x5e); pak.addUint16(freeSlot, 1); pak.addUint32(itemId, 1); pak.addUint16(0, 1); pak.addUintShort(amount); pak.addUintShort(type); pak.addUintShort(1); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendDeleteViewPacket(WorldClient client, UInt16 viewIdToDelete) { PacketContent pak = new PacketContent(); pak.addUint16(1, 1); // Master View pak.addByte(0x01); pak.addUint16(1, 1); // Num Views to delete - current just this one (maybe later more) pak.addUint16(viewIdToDelete, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); }
/// <summary> /// This sends a View Create/Update/Delete Packet to all Players /// </summary> /// <param name="data">Packet Stream without ViewID</param> /// <param name="charId">from charId</param> /// <param name="goId">from GoId</param> public void sendViewPacketToAllPlayers(byte[] data, UInt32 charId, UInt32 goId, UInt64 entityId) { // Send a global message to all connected Players (like shut down Server announce or something) lock (Clients.SyncRoot) { foreach (string clientKey in Clients.Keys) { WorldClient client = Clients[clientKey] as WorldClient; if (client.playerData.getCharID() != charId) { #if DEBUG Output.Write("[ViewThread] Handle View For all Packet for charId : " + charId.ToString()); #endif // Get or generate a View for the GoID ClientView view = client.viewMan.getViewForEntityAndGo(entityId, goId); PacketContent viewPacket = new PacketContent(); if (view.viewCreated == false) { // if view is new , add the viewId at the end (cause its creation) // Remove the 03 01 00 (as it was generate previosly) viewPacket.addByteArray(data); viewPacket.addUint16(view.ViewID, 1); viewPacket.addByte(0x00); } else { // Update View viewPacket.addUint16(view.ViewID, 1); viewPacket.addByteArray(data); viewPacket.addByte(0x00); } if (view.viewNeedsToBeDeleted == true) { // Delete one View viewPacket.addByte(0x01); viewPacket.addByte(0x00); viewPacket.addByte(0x01); // Comand (Delete) viewPacket.addUint16(1, 1); // NumViews to Delete viewPacket.addUint16(view.ViewID, 1); viewPacket.addByte(0x00); } client.messageQueue.addObjectMessage(viewPacket.returnFinalPacket(), false); client.FlushQueue(); } } } }
public void SpawnMobView(WorldClient client, Mob thismob, ClientView mobView) { Output.WriteDebugLog("Spawn MobView Data ( Entity ID : " + thismob.getEntityId() + " Name:" + thismob.getName() + " ID: " + thismob.getMobId() + " RSI HEX: " + thismob.getRsiHex()); Object599 viewData = thismob.getCreationData(); PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addByteArray(Store.world.objMan.GenerateCreationPacket(viewData, 0x0000, client.playerData.assignSpawnIdCounter()).getBytes()); pak.addUint16(mobView.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); }
public void sendSetMissionObjective(ushort id, ushort state, string missionObjective, WorldClient client) { //format : rpcsize+uint16header+ uint8(0) + uint16(0600), + uint8 state + sizedString (uint16 size + string + 00?) PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_SET_OBJECTIVE, 0); pak.addUintShort(id); pak.addUint16(6, 1); pak.addUintShort(state); pak.addSizedTerminatedString(missionObjective); Output.WriteRpcLog("MISSION PAK: " + StringUtils.bytesToString(pak.returnFinalPacket())); // Now send the message to the player queue client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendCrewInviteToPlayer(string playerHandle, string crewName) { // ToDo: fix the name display issue ? string charname = StringUtils.charBytesToString_NZ(Store.currentClient.playerInstance.CharacterName.getValue()); UInt16 crewOffset = (UInt16)(charname.Length + 7 + 3); PacketContent pak = new PacketContent(); pak.addHexBytes("8088"); // ToDo: is this the RPC Response Header ? pak.addUint16(7, 1); // Start Offsset for Charactername pak.addUint16(crewOffset, 1); pak.addByte(0x01); pak.addSizedTerminatedString(StringUtils.charBytesToString_NZ(Store.currentClient.playerInstance.CharacterName.getValue())); pak.addSizedTerminatedString(crewName); Store.world.sendRPCToOnePlayerByHandle(pak.returnFinalPacket(), playerHandle); }
public void sendGetBackgroundMessage(WorldClient client) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_PLAYER_GET_BACKGROUND, 0); pak.addByte(0x05); pak.addUint16(0, 1); // Get Data from DB and save Hashtable characterData = Store.dbManager.WorldDbHandler.getCharInfo(client.playerData.getCharID()); String backgroundTextt = characterData["background"].ToString(); pak.addSizedTerminatedString(backgroundTextt); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void SendNpcDies(UInt16 viewId, WorldClient client, Mob theMob) { // Falls to ground like dead lol //activate loot+f PacketContent pak = new PacketContent(); pak.addUint16(viewId, 1); pak.addHexBytes("0501c20200808100000000e0010000c0830000de810303fd070000000000000000"); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); PacketContent fallToGroundPak = new PacketContent(); fallToGroundPak.addUint16(viewId, 1); fallToGroundPak.addHexBytes("02010d000000000000000000000000000000"); client.messageQueue.addObjectMessage(fallToGroundPak.returnFinalPacket(), false); // lie on the ground PacketContent pak2 = new PacketContent(); pak2.addUint16(viewId, 1); pak2.addHexBytes("02010d000000000000000000000000000000"); client.messageQueue.addObjectMessage(pak2.returnFinalPacket(), false); client.FlushQueue(); }
public void sendPlayerFriendList(WorldClient client) { ArrayList friends = Store.dbManager.WorldDbHandler.fetchFriendList(Store.currentClient.playerData.getCharID()); if (friends.Count > 0) { foreach (Hashtable friend in friends) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_FRIENDLIST_STATUS, 0); pak.addHexBytes("0800"); if ((Int16)friend["online"] == 1) { pak.addByte(0x3c); } else { pak.addByte(0x3b); } pak.addHexBytes("0000"); pak.addByte(0x8e); // Another unknown flag ...mxosource made it wrong lol pak.addSizedTerminatedString("SOE+MXO+" + friend["handle"]); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); } } }
public void HitEnemyWithDamage(ushort hitValue, uint hitFxId) { // Change to combat so that he isnt moving anymore currentState = (int)statusList.COMBAT; if (healthC - hitValue <= 0) { healthC = 0; } else { healthC -= hitValue; } hitCounter++; // Format 04 80 80 80 80 c0 <uint16 health> c0 <uint32 fxid> 01(but unknown for what it is) <uint8 random> // Example Full: send 02 03 <viewID> 04 80 80 80 c0 02 00 c0 c1 01 00 28 01 01 00 00; var hitPacket = new PacketContent(); hitPacket.addByte(0x04); hitPacket.addByte(0x80); hitPacket.addByte(0x80); hitPacket.addByte(0x80); hitPacket.addByte(0xc0); hitPacket.addUint16(healthC, 1); hitPacket.addByte(0xc0); hitPacket.addUint32(hitFxId, 1); // FX ID hitPacket.addByte(0x01); hitPacket.addUintShort(hitCounter); // Animation Count or something - must be an another as before Store.world.SendViewUpdateToClientsWhoHasSpawnedView(hitPacket, this); }
public void sendEXPCurrent(WorldClient client, UInt32 exp) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_PLAYER_EXP, 0); pak.addUint32(exp, 1); pak.addHexBytes("00000000"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendExitGame(WorldClient client) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_JACKOUT_FINISH, 0); pak.addHexBytes("000000000000"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
private void sendMarginCharData(byte[] data, byte opcode, NetworkStream client, UInt16 shortAfterId, bool isLast) { // This Method will be used to send the real Data to the client // Format for general LoadCharacterReply Responses: // 10 00 00 00 <- everytime the same // 00 f9 76 04 <- uint32 Char ID // 00 00 00 09 <- uint32 number of Character Replys (just raise one up) // 00 05 <- viewData opcode (what data is inside) uint16 // 10 00 <- if it has Data it is 10 00 if not is just 00 00 (and no Data can follow up and packet ends here) // e1 00 <- short / uint16 data size // DATA numCharacterReplies++; PacketContent pak = new PacketContent(); pak.addByte(0x10); pak.addUint32(0, 1); pak.addUint32(newCharID, 1); pak.addUint16(shortAfterId, 1); pak.addUintShort(numCharacterReplies); if (isLast) { pak.addUintShort(1); } else { pak.addUintShort(0); } pak.addUintShort(opcode); if (data.Length > 0) { pak.addByteArray(new byte[] { 0x10, 0x00 }); pak.addUint16((UInt16)data.Length, 1); pak.addByteArray(data); } else { pak.addByteArray(new byte[] { 0x00, 0x00 }); } Output.WriteDebugLog("[MARGIN SERVER RESPONSE] for OPCODE " + opcode + " : " + StringUtils.bytesToString(pak.returnFinalPacket())); byte[] encryptedResponse = marginEncr.encrypt(pak.returnFinalPacket()); sendTCPVariableLenPacket(encryptedResponse, client); System.Threading.Thread.Sleep(50); }
public void SendLootAccepted(WorldClient client) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOOT_ACCEPTED_RESPONSE, 0); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); client.FlushQueue(); }
public void sendTeamCreation(WorldClient client, string missionTeamName) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_TEAM_CREATE, 0); pak.addHexBytes("2A0000020E00040000000000"); // Unknown mostly pak.addSizedTerminatedString(missionTeamName); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendVendorWindow() { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_VENDOR_OPEN, 0); pak.addHexBytes("7cadd94300000000a0b7f6c000000000003c9440000000000051c8c020000a0000140080002000800018008000040080002c008000f41180009806800090078000c4068000640680"); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendCrewAndFactionEnableWindow(WorldClient client) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_FACTION_ENABLED_WINDOW, 0); pak.addHexBytes("15A0070000000000000000000000000000000000000000210000000000230000000000"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendHyperJumpID(UInt32 possibleJumpID) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_HYPERJUMP_ID, 0); pak.addUint32(possibleJumpID, 1); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
// ToDo: if other clients invite this player to a team public void sendTeamInvitation(WorldClient client, string inviterCharname, string missionTeamName) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_TEAM_INVITE_MEMBER, 0); pak.addHexBytes("0C001C00000000000000"); // Unknown pak.addSizedTerminatedString(inviterCharname); pak.addSizedTerminatedString(missionTeamName); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendSpawnStaticObject(WorldClient client, GameObject creationObjectData, UInt64 entityID) { ClientView staticObjectView = client.viewMan.getViewForEntityAndGo(entityID, NumericalUtils.ByteArrayToUint16(creationObjectData.GetGoid(), 1)); if (staticObjectView.viewCreated == false) { PacketContent pak = new PacketContent(); pak.addUint16(1, 1); pak.addByteArray(Store.world.objMan.GenerateCreationPacket(creationObjectData, 0x0000, client.playerData.assignSpawnIdCounter()).getBytes()); pak.addUint16(staticObjectView.ViewID, 1); pak.addByte(0x00); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.FlushQueue(); staticObjectView.viewCreated = true; } }
public void sendInfoCurrent(WorldClient client, UInt32 info) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_PLAYER_INFO, 0); pak.addUint32(info, 1); pak.addHexBytes("00000000"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendFactionName(WorldClient client, UInt32 factionID, string factionName) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_FACTION_NAME_RESPONSE, 0); pak.addUint32(factionID,1); // Add 42 Bytes long faction name pak.addStringWithFixedSized(factionName, 42); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendPlayFXOnView(UInt16 viewId, WorldClient client, byte animation, UInt16 incrementCounter) { PacketContent pak = new PacketContent(); pak.addUint16(viewId, 1); // ToDo later : make a real Object Update pak.addByte(0x02); pak.addByte(0x80); pak.addByte(0x80); pak.addByte(0x80); pak.addByte(0x90); pak.addByte(0xed); pak.addByte(0x00); pak.addByte(0x30); pak.addByte(animation); pak.addUint16(incrementCounter, 1); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public void sendMissionInfo(WorldClient client) { // Test a MissionList PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISION_INFO_RESPONSE, 0); pak.addHexBytes("0000000000002f000100000002a29f7e46a29f7e46000000000000000000d0060000310000b4c00c0028"); pak.addHexBytes("42000001000002000D001300020002030200FFFFFDFF"); pak.addSizedTerminatedString("Eliminate Agent Smith"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); client.flushQueue(); }
public void processHardlineExitRequest(ref byte[] packet) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_EXIT_HL, 0); pak.addByte(0x95); pak.addByte(0x00); pak.addByte(0x00); pak.addByte(0x00); pak.addByte(0x01); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendMissionAccept(WorldClient client, UInt16 contactId, ushort missionId) { // This is still a testing message mate PacketContent selfUpdate = new PacketContent(); selfUpdate.addHexBytes("0200028040002a03020000"); client.messageQueue.addObjectMessage(selfUpdate.returnFinalPacket(), false); PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_SET_NAME, 0); pak.addHexBytes("00000000"); pak.addUint16(contactId, 1); pak.addHexBytes("2B0001002F0002D0070000310000B4C00C002814000026700A00280100003E003B00000E00417373617373696E6174696F6E000100000300AA0600009C070000DC050000"); PacketContent pak2 = new PacketContent(); pak2.addHexBytes("80A33000030078001A000000030000003C000010EF4600007FC30020E4C50088DB4600007FC300E0ABC500000000000032015768696C65206F7665727420636F6E666C696374207365727665732069747320707572706F73652C20736F6D6574696D65732061206D6F726520737562746C6520617070726F6163682069732072657175697265642E20496E207468697320636173652C20616E20617373617373696E6174696F6E2E0D0A0D0A496E206F7264657220746F2072656163682042656E67742C20796F752077696C6C206669727374206E65656420746F206163717569726520612063657274696E2044617461204469736B207468617420686F6C64"); // This tells the location PacketContent pak4 = new PacketContent(); pak4.addHexBytes("809E00000000000026DB40000000008078C1400000000000F8B1C00100000022018007"); PacketContent pak5 = new PacketContent(); pak5.addHexBytes("80A0000600002500476574207468652044617461204469736B2066726F6D20746865206D61696E6672616D6500"); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); client.messageQueue.addRpcMessage(pak2.returnFinalPacket()); client.messageQueue.addRpcMessage(pak4.returnFinalPacket()); client.messageQueue.addRpcMessage(pak5.returnFinalPacket()); /* PacketContent pakWayPoint = new PacketContent(); pakWayPoint.addHexBytes("01000213001200020C9DE1B8D747F0BF2D443752BA450000"); client.messageQueue.addObjectMessage(pakWayPoint.returnFinalPacket(),false); */ client.flushQueue(); }
public void sendEmotePerform(WorldClient client, UInt32 emoteID) { double x = 0; double y = 0; double z = 0; byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue(); NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z); int rotation = (int)Store.currentClient.playerInstance.YawInterval.getValue()[0]; float xPos = (float)x; float yPos = (float)y; float zPos = (float)z; /* byte sampleEmoteMsg[] = { 0x03, 0x02, 0x00, 0x01, 0x28, 0xAA, 0x40, 0x00, 0x25, 0x01, 0x00, 0x00, 0x10, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xDD, 0x2A, 0x9F, 0x1E, 0x20, 0x00, 0x00, };*/ // Example REsponse for /rolldice 02 03 02 00 01 28 01 40 00 25 <ID> 00 00 10 cd a7 65 c7 00 00 be 42 33 ff 72 46 b9 51 32 22 00 00 // Example REsponse for /rolldice 02 03 02 00 01 28 01 40 00 25 5c 00 00 10 cd a7 65 c7 00 00 be 42 33 ff 72 46 b9 51 32 22 00 00 // Example Response for ClapEmote: 02 03 02 00 01 28 06 40 00 25 04 00 00 10 34 49 84 c7 00 00 be 42 27 a4 7f 46 b3 a6 5e 18 00 00 // Python Example self.emotePacket="\x02\x03\x02\x00\x01\x28<emoteNum>\x40\x00\x25<emoteID>\x00\x00\x10<coordX><coordY><coordZ>\x2a\x9f\x1e\x20\x00\x00" // 02 03 02 00 01 28 01 40 00 25 01 00 00 ea 33 47 00 00 be 42 80 55 bd c7 b9 51 32 22 00 00 // ToDo: parse list and get the f*****g id from uint DataLoader objectLoader = DataLoader.getInstance(); byte emoteByte = new byte(); emoteByte = objectLoader.findEmoteByLongId(emoteID); if(emoteByte>0) { byte[] emotePak = { 0x01, 0x28, 0x01, 0x40, 0x00, 0x25, emoteByte, 0x00, 0x00, 0x10 }; PacketContent pak = new PacketContent(); pak.addUint16(2, 1); pak.addByteArray(emotePak); pak.addFloatLtVector3f(xPos, yPos, zPos); pak.addHexBytes("b9513222"); // We dont know what they are - maybe rotation ? pak.addByte(0x00); //pak.addByteArray(client.playerInstance.Position.getValue()); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); } }
public void sendChatMessage(WorldClient fromClient, string message, UInt32 charId, string handle, string scope) { byte typeByte; switch (scope) { case "TEAM": typeByte = 0x05; break; case "CREW": typeByte = 0x02; break; case "FACTION": typeByte = 0x03; break; case "AREA": typeByte = 0x10; break; default: typeByte = 0x07; break; } UInt16 messageSize = (UInt16)(message.Length + 1); byte[] messageSizeHex = NumericalUtils.uint16ToByteArray(messageSize, 1); UInt32 offsetMessage = (uint)handle.Length + 35 + 2 + 2; PacketContent pak = new PacketContent(); pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE); pak.addByte(typeByte); pak.addUint32(charId, 0); pak.addUint16(36, 0); pak.addUint32(offsetMessage, 0); pak.addHexBytes("000000000000000000000000000000000000000000000000"); pak.addSizedTerminatedString(handle); pak.addSizedTerminatedString(message); Store.world.sendRPCToAllOtherPlayers(Store.currentClient.playerData, pak.returnFinalPacket()); }
public void processHardlineTeleport(ref byte[] packet) { // we dont care where the journey goes // just want to see IF the journey will do :) // for this just ack and send 0x42 packet byte[] sourceHardline = new byte[2]; sourceHardline[0] = packet[0]; sourceHardline[1] = packet[1]; byte[] sourceDistrict = new byte[2]; sourceDistrict[0] = packet[4]; sourceDistrict[1] = packet[5]; byte[] destHardline = new byte[2]; destHardline[0] = packet[8]; destHardline[1] = packet[9]; byte[] destDistrict = new byte[2]; destDistrict[0] = packet[12]; destDistrict[1] = packet[13]; UInt16 sourceHL = NumericalUtils.ByteArrayToUint16(sourceHardline,1); UInt16 sourceDIS = NumericalUtils.ByteArrayToUint16(sourceDistrict,1); UInt16 destHL = NumericalUtils.ByteArrayToUint16(destHardline, 1); UInt16 destDIS = NumericalUtils.ByteArrayToUint16(destDistrict,1); // This should do the magic - we just catch Store.dbManager.WorldDbHandler.updateLocationByHL(destDIS, destHL); Store.dbManager.WorldDbHandler.updateSourceHlForObjectTracking(sourceDIS, sourceHL, Store.currentClient.playerData.lastClickedObjectId); ServerPackets serverPak = new ServerPackets(); serverPak.sendSystemChatMessage(Store.currentClient,"User wants teleport from : HL ID: " + sourceHL.ToString() + " (DIS: " + sourceDIS.ToString() + " ) TO HL ID: " + destHL.ToString() + " (DIS: " + destDIS.ToString() + ") ","MODAL"); // Tell client we want to unload the World PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOAD_RPC_RESET, 0); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); Store.currentClient.flushQueue(); }
public void processLoadAbility(ref byte[] packet) { // read the values from the packet byte[] staticObjectByteID = new byte[4]; ArrayUtils.copyTo(packet, 0, staticObjectByteID, 0, 4); byte[] unloadFlagByte = new byte[2]; ArrayUtils.copyTo(packet, 4, unloadFlagByte, 0, 2); byte[] loadFlagByte = new byte[2]; ArrayUtils.copyTo(packet, 6, loadFlagByte, 0, 2); byte[] countAbilityBytes = new byte[2]; ArrayUtils.copyTo(packet, 8, countAbilityBytes, 0, 2); UInt16 countAbilities = NumericalUtils.ByteArrayToUint16(countAbilityBytes, 1); // Get the Ability Related Header Data UInt32 staticObjectID = NumericalUtils.ByteArrayToUint32(staticObjectByteID, 1); UInt16 unloadFlag = NumericalUtils.ByteArrayToUint16(unloadFlagByte, 1); UInt16 loadFlag = NumericalUtils.ByteArrayToUint16(loadFlagByte, 1); int pointer = 11; // Start at index 11 List<UInt16> abilitySlots = new List<UInt16>(); for (int i = 1; i <= countAbilities; i++) { // This must be looped byte[] slotByteID = new byte[2]; ArrayUtils.copyTo(packet, pointer, slotByteID, 0, 2); pointer = pointer + 2; byte[] abilityByteID = new byte[2]; ArrayUtils.copyTo(packet, pointer, abilityByteID, 0, 2); pointer = pointer + 4; byte[] abilityByteLevel = new byte[2]; ArrayUtils.copyTo(packet, pointer, abilityByteLevel, 0, 2); pointer = pointer + 3; UInt16 slotID = NumericalUtils.ByteArrayToUint16(slotByteID, 1); UInt16 AbilityID = NumericalUtils.ByteArrayToUint16(abilityByteID, 1); UInt16 AbilityLevel = NumericalUtils.ByteArrayToUint16(abilityByteLevel, 1); PacketContent pak = new PacketContent(); if (unloadFlag > 0) { pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_UNLOAD, 0); pak.addByteArray(abilityByteID); } else { pak.addUint16((UInt16)RPCResponseHeaders.SERVER_ABILITY_LOAD, 0); pak.addByteArray(abilityByteID); pak.addByteArray(abilityByteLevel); pak.addByteArray(slotByteID); } abilitySlots.Add(slotID); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); } if (unloadFlag > 0) { Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 0); } else { Store.dbManager.WorldDbHandler.updateAbilityLoadOut(abilitySlots, 1); } }
public void processTeleportReset(ref byte[] packet) { Store.currentClient.playerData.setRPCShutDown(true); // We want to reset PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOAD_WORLD, 0); Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void testCloseCombat(ref byte[] packet) { byte[] targetViewWithSpawnId = new byte[4]; ArrayUtils.copy(packet, 0, targetViewWithSpawnId, 0, 4); string hexString = StringUtils.bytesToString_NS(targetViewWithSpawnId); string hexStringPak = StringUtils.bytesToString_NS(packet); Store.currentClient.messageQueue.addObjectMessage(StringUtils.hexStringToBytes("020003010C00808400808080800100001000"), false); // Make me combat mode "on" // The 55 View Packet PacketContent ilCombatHandler = new PacketContent(); ilCombatHandler.addHexBytes("01000C370036CDAB0205"); ilCombatHandler.addByteArray(Store.currentClient.playerInstance.Position.getValue()); ilCombatHandler.addHexBytes("cdec4023"); // Time starts i think ilCombatHandler.addHexBytes("fd0000"); // view ID fd00 Store.currentClient.messageQueue.addObjectMessage(ilCombatHandler.returnFinalPacket(), false); Store.currentClient.flushQueue(); // The other 03 Packet for combat PacketContent unknownCreatePak = new PacketContent(); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("010002A700")); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("FD00")); // ViewID from Combat Object unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01")); unknownCreatePak.addByteArray(Store.currentClient.playerInstance.Position.getValue()); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("0100000003000000")); unknownCreatePak.addByteArray(targetViewWithSpawnId); unknownCreatePak.addUint16(2, 1); unknownCreatePak.addUint16(Store.currentClient.playerData.selfSpawnIdCounter, 1); unknownCreatePak.addByteArray(StringUtils.hexStringToBytes("01010207030000200BF5C2000020C19420B9C300000000000020C100000000070001001201000007037608E00603145200008B0B0024145200008B0B0024882300008B0B00240000000000000000000000000000000064000000640000000010001010000000020000001000000002000000000000000000000000")); Store.currentClient.messageQueue.addObjectMessage(unknownCreatePak.returnFinalPacket(), false); Store.currentClient.flushQueue(); }
// Updates the Inner Strenght Value public void sendISCurrent(WorldClient client, UInt16 innerStrengthValue ) { PacketContent pak = new PacketContent(); pak.addUint16(2, 1); pak.addByte(0x02); pak.addByteArray(new byte[]{0x80,0x80,0x80}); pak.addByte(0x10); pak.addUint16(innerStrengthValue,1); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public void sendMoodChange(WorldClient client, byte moodByte) { byte[] moodPak = { 0x02, 0x00, 0x01, 0x01, 0x00, moodByte, 0x00, 0x00 }; PacketContent pak = new PacketContent(); pak.addUint16(2, 1); pak.addByte(0x02); pak.addByteArray(moodPak); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public void sendPlayerSpawn(WorldClient receiverClient, WorldClient otherClient, UInt16 viewId) { PacketContent pak = new PacketContent(); byte[] spawnPaket = new BootingHelperRsi().generatePlayerSpawnPacket(otherClient, receiverClient.playerData.assignSpawnIdCounter()); pak.addByteArray(spawnPaket); pak.addUint16(viewId,1); pak.addByte(0x00); receiverClient.messageQueue.addObjectMessage(pak.returnFinalPacket(),false); receiverClient.flushQueue(); }
public void sendPlayerFriendList(WorldClient client) { ArrayList friends = Store.dbManager.WorldDbHandler.fetchFriendList(Store.currentClient.playerData.getCharID()); if (friends.Count > 0) { foreach (Hashtable friend in friends) { PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_FRIENDLIST_STATUS, 0); pak.addHexBytes("0800"); if ((Int16)friend["online"] ==1) { pak.addByte(0x3c); } else { pak.addByte(0x3b); } pak.addHexBytes("0000"); pak.addByte(0x8e); // Another unknown flag ...mxosource made it wrong lol pak.addSizedTerminatedString("SOE+MXO+" + friend["handle"]); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); } } }
public void sendPlayerAnimation(WorldClient client, String hexAnimation) { // See animations.txt - hex animation is the first Id // Some samples: /* * 7312 1273 = Stand_Abil_ProgLauSelectivePhage2s_A 7412 1274 = Stand_Abil_ProgLauSelectivePhage4s_A 7512 1275 = Stand_Abil_ProgLauSelectivePhage6s_A 7612 1276 = Stand_Abil_ProgLauSelectivePhage8s_A */ Random rand = new Random(); byte[] Ltvector3d = Store.currentClient.playerInstance.Position.getValue(); double x = 0; double y = 0; double z = 0; NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z); float xPos = (float)x; float yPos = (float)y; float zPos = (float)z; PacketContent pak = new PacketContent(); pak.addUint16(2, 1); pak.addByteArray(new byte[]{0x01,0x28}); pak.addUintShort((ushort)rand.Next(0, 255)); pak.addByteArray(new byte[] { 0x40, 00 }); pak.addByte(0x29); pak.addHexBytes(hexAnimation); pak.addByteArray(new byte[] { 0x00, 0x01 }); pak.addFloat(xPos,1); pak.addFloat(yPos,1); pak.addFloat(zPos,1); pak.addByteArray(new byte[] {0x20, 0x9f, 0x1e, 0x20}); pak.addUint16(0, 1); client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false); client.flushQueue(); }
public void sendMissionList(UInt16 contactId, uint orgID, WorldClient client) { /* * ToDo: check if mission team was created or not */ /* * ToDo: Figure the "unknowns" out * Examples: * Neo: 18 80 95 00 00 00 00 06 00 07 00 00 01 d0 07 00 00 31 00 00 b4 c0 0c 00 28 * Luz: 18 80 95 00 00 00 00 05 00 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 */ PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_LIST,0); pak.addUint32(0, 0); pak.addUint16(contactId, 1); pak.addUint16(7,1); // Unknown - in neo it has 1 pak.addUintShort(0); pak.addUintShort((ushort)orgID); pak.addHexBytes("000000000000000000000000"); // The big unknown part - maybe some informations about the contact client.messageQueue.addRpcMessage(pak.returnFinalPacket()); // ToDo: make it dynamic from a file or something ArrayList possibleMissions = new ArrayList(); possibleMissions.Add("Assassination"); possibleMissions.Add("Hack the Duality"); possibleMissions.Add("Welcome to 2015"); possibleMissions.Add("Party like '99"); UInt16 i = 0; foreach (string mission in possibleMissions) { PacketContent missionListPak = new PacketContent(); missionListPak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_NAME, 0); missionListPak.addUint16(contactId, 1); missionListPak.addUint16(i, 1); missionListPak.addHexBytes("0f0001d00700000000"); // curently unknown missionListPak.addSizedTerminatedString(mission); client.messageQueue.addRpcMessage(missionListPak.returnFinalPacket()); i++; } // And finally again a resposne PacketContent finalResponse = new PacketContent(); finalResponse.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_RESPONSE_UNKNOWN, 0); finalResponse.addUint16(contactId, 1); client.messageQueue.addRpcMessage(finalResponse.returnFinalPacket()); }
public void sendSetMissionObjective(ushort id, ushort state, string missionObjective, WorldClient client) { //format : rpcsize+uint16header+ uint8(0) + uint16(0600), + uint8 state + sizedString (uint16 size + string + 00?) PacketContent pak = new PacketContent(); pak.addUint16((UInt16)RPCResponseHeaders.SERVER_MISSION_SET_OBJECTIVE, 0); pak.addUintShort(id); pak.addUint16(6, 1); pak.addUintShort(state); pak.addSizedTerminatedString(missionObjective); Output.WriteRpcLog("MISSION PAK: " + StringUtils.bytesToString(pak.returnFinalPacket())); // Now send the message to the player queue client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }