public addSizedTerminatedString ( string value ) : void | ||
value | string | |
return | void |
// 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()); }
// 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 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 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 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 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 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 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 sendSaveCharDataMessage(WorldClient client, string handle) { PacketContent pak = new PacketContent(); pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE); pak.addHexBytes("0700000000000000000000006400002E00240000000000000000000000000000000000"); pak.addSizedTerminatedString(handle); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
public void sendWorldCMD(WorldClient client, uint districtId, string enviromentOptions) { // Prepare the dict Dictionary <uint, string> locs = new Dictionary <uint, string>(); locs.Add((uint)MxOLocations.TUTORIAL, "resource/worlds/final_world/tutorial_v2/tutorial_v2.metr"); locs.Add((uint)MxOLocations.SLUMS, "resource/worlds/final_world/slums_barrens_full.metr"); locs.Add((uint)MxOLocations.DOWNTOWN, "resource/worlds/final_world/downtown/dt_world.metr"); locs.Add((uint)MxOLocations.INTERNATIONAL, "resource/worlds/final_world/international/it.metr"); locs.Add((uint)MxOLocations.ARCHIVE01, "resource/worlds/final_world/constructs/archive/archive01/archive01.metr"); locs.Add((uint)MxOLocations.ARCHIVE02, "resource/worlds/final_world/constructs/archive/archive02/archive02.metr"); locs.Add((uint)MxOLocations.ASHENCOURT, "resource/worlds/final_world/constructs/archive/archive_ashencourte/archive_ashencourte.metr"); locs.Add((uint)MxOLocations.DATAMINE, "resource/worlds/final_world/constructs/archive/archive_datamine/datamine.metr"); locs.Add((uint)MxOLocations.SAKURA, "resource/worlds/final_world/constructs/archive/archive_sakura/archive_sakura.metr"); locs.Add((uint)MxOLocations.SATI, "resource/worlds/final_world/constructs/archive/archive_sati/sati.metr"); locs.Add((uint)MxOLocations.WIDOWSMOOR, "resource/worlds/final_world/constructs/archive/archive_widowsmoor/archive_widowsmoor.metr"); locs.Add((uint)MxOLocations.YUKI, "resource/worlds/final_world/constructs/archive/archive_yuki/archive_yuki.metr"); locs.Add((uint)MxOLocations.LARGE01, "resource/worlds/final_world/constructs/large/large01/large01.metr"); locs.Add((uint)MxOLocations.LARGE02, "resource/worlds/final_world/constructs/large/large02/large02.metr"); locs.Add((uint)MxOLocations.MEDIUM01, "resource/worlds/final_world/constructs/medium/medium01/medium01.metr"); locs.Add((uint)MxOLocations.MEDIUM02, "resource/worlds/final_world/constructs/medium/medium02/medium02.metr"); locs.Add((uint)MxOLocations.MEDIUM03, "resource/worlds/final_world/constructs/medium/medium03/medium03.metr"); locs.Add((uint)MxOLocations.SMALL03, "resource/worlds/final_world/constructs/small/small03/small03.metr"); locs.Add((uint)MxOLocations.CAVES, "resource/worlds/final_world/zion_caves.metr"); string path = locs[districtId]; UInt16 offsetWeatherEvent = (UInt16)(path.Length + 17); PacketContent pak = new PacketContent(); pak.addUintShort((ushort)RPCResponseHeaders.SERVER_LOAD_WORLD_CMD); pak.addUintShort(0x0e); // dunno if header or not - just part of this pak.addUintShort(0); pak.addUint32(districtId, 1); // Atlas Byte pak.addByteArray(TimeUtils.getCurrentSimTime()); pak.addByte(0x01); // SimeTime + 01 pak.addUint16(offsetWeatherEvent, 1); pak.addSizedTerminatedString(path); pak.addSizedTerminatedString(enviromentOptions); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
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 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 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 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()); }
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 sendSystemChatMessage(WorldClient client, string message, string type) { byte typeByte; switch (type) { case "SYSTEM": typeByte = 0x07; break; case "MODAL": typeByte = 0x17; break; case "FRAMEMODAL": typeByte = 0xd7; break; case "BROADCAST": typeByte = 0xc7; break; default: typeByte = 0x07; break; } UInt16 messageSize = (UInt16)(message.Length + 1); byte[] hexContents = StringUtils.hexStringToBytes("00000000000000000024000000000000000000000000000000000000000000000000"); PacketContent pak = new PacketContent(); pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE); pak.addByte(typeByte); pak.addByteArray(hexContents); pak.addSizedTerminatedString(message); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); client.FlushQueue(); }
public void sendSystemChatMessage(WorldClient client, string message, string type) { byte typeByte; switch (type) { case "SYSTEM": typeByte = 0x07; break; case "MODAL": typeByte = 0x17; break; case "FRAMEMODAL": typeByte = 0xd7; break; case "BROADCAST": typeByte = 0xc7; break; default: typeByte = 0x07; break; } UInt16 messageSize = (UInt16)(message.Length + 1); byte[] hexContents = StringUtils.hexStringToBytes("00000000000000000024000000000000000000000000000000000000000000000000"); PacketContent pak = new PacketContent(); pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE); pak.addByte(typeByte); pak.addByteArray(hexContents); pak.addSizedTerminatedString(message); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); 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 sendSaveCharDataMessage(WorldClient client, string handle) { PacketContent pak = new PacketContent(); pak.addByte((byte)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE); pak.addHexBytes("0700000000000000000000006400002E00240000000000000000000000000000000000"); pak.addSizedTerminatedString(handle); client.messageQueue.addRpcMessage(pak.returnFinalPacket()); }
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 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()); }