addHexBytes() 공개 메소드

public addHexBytes ( String hexbytes ) : void
hexbytes String
리턴 void
예제 #1
0
        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());
        }
예제 #2
0
        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();
        }
예제 #3
0
        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());
                }
            }
        }
예제 #4
0
 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();
 }
예제 #5
0
        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();
        }
예제 #6
0
        public void sendHyperSpeed()
        {
            byte[]        updateCount = NumericalUtils.uint16ToByteArrayShort(Store.currentClient.playerData.assignSpawnIdCounter());
            PacketContent pak         = new PacketContent();

            pak.addUint16(2, 1);
            pak.addHexBytes("0288058c1e6666F63F80903200b056060028");
            pak.addByteArray(updateCount);
            pak.addHexBytes("0200000000");
            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
            Store.currentClient.flushQueue();
        }
예제 #7
0
        public void processVendorOpen(ref byte[] objectID)
        {
            PacketContent pak = new PacketContent();

            pak.addHexBytes("810D7CADD943000000A07EB1D1400000008000BEA940000000E0E74CA7402000140000140080002000800018008000040080002C008000F4118000540680004C088000BC06800000068000AC058000700D8000740D8000900D8000940D8000980D80009C0D8000240080003C0080001C0080");
            Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket());
        }
예제 #8
0
        public void sendLootWindowTest(WorldClient client, UInt32 objectId)
        {
            // This is just for reversing the missing model IDs
            PacketContent pak = new PacketContent();

            pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOOT_WINDOW_RESPONSE, 0);
            pak.addHexBytes("000000001000");
            pak.addUint32(99999, 1);
            pak.addHexBytes("00000000010000000008");
            if (objectId > 0)
            {
                pak.addUint32(objectId, 1);
            }
            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
            client.FlushQueue();
        }
예제 #9
0
 public void sendMissionAbort(WorldClient client)
 {
     PacketContent pak = new PacketContent();
     pak.addHexBytes("80a20800000000b4658db5000000000000000000000000000000");
     client.messageQueue.addRpcMessage(pak.returnFinalPacket());
     client.flushQueue();
 }
예제 #10
0
        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();
        }
예제 #11
0
        public void SendLootWindow(UInt32 infoAmount, WorldClient client, UInt32[] objectIds)
        {
            // ToDo: figure the real object packet out (with more than one object) and show it up
            PacketContent pak = new PacketContent();

            pak.addUint16((UInt16)RPCResponseHeaders.SERVER_LOOT_WINDOW_RESPONSE, 0);
            pak.addHexBytes("000000001000");
            pak.addUint32(infoAmount, 1);
            pak.addHexBytes("00000000010000000008");
            if (objectIds.Length > 0)
            {
                pak.addUint32(objectIds[0], 1);
            }
            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
            client.FlushQueue();
        }
예제 #12
0
        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();
        }
예제 #13
0
        public void sendMissionAbort(WorldClient client)
        {
            PacketContent pak = new PacketContent();

            pak.addHexBytes("80a20800000000b4658db5000000000000000000000000000000");
            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
            client.flushQueue();
        }
예제 #14
0
        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());
        }
예제 #15
0
        public void sendVendorWindow()
        {
            PacketContent pak = new PacketContent();

            pak.addUint16((UInt16)RPCResponseHeaders.SERVER_VENDOR_OPEN, 0);
            pak.addHexBytes("7cadd94300000000a0b7f6c000000000003c9440000000000051c8c020000a0000140080002000800018008000040080002c008000f41180009806800090078000c4068000640680");
            Store.currentClient.messageQueue.addRpcMessage(pak.returnFinalPacket());
        }
예제 #16
0
        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());
        }
예제 #17
0
파일: TeamPackets.cs 프로젝트: hdneo/mxo-hd
 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());
 }
예제 #18
0
        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());
        }
예제 #19
0
파일: TeamPackets.cs 프로젝트: hdneo/mxo-hd
 // 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());
 }
예제 #20
0
        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());
        }
예제 #21
0
        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());
        }
예제 #22
0
        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());
        }
예제 #23
0
        private byte[] loadBackgroundInfo(int charID)
        {
            MarginCharacter marginCharacter = Store.dbManager.MarginDbHandler.getCharInfo(charID);


            PacketContent pak = new PacketContent();

            if (!isNewCreatedChar)
            {
                pak.addByteArray(StringUtils.hexStringToBytes("01000000640000007B0000006500000000000000000000006C000000000000002B010000"));
            }
            pak.addStringWithFixedSized(marginCharacter.firstname, 32);
            pak.addStringWithFixedSized(marginCharacter.lastname, 32);
            pak.addStringWithFixedSized(marginCharacter.background, 1024);


            // ToDo: Analyse it and (Rep zion => 82, Rep Machine 2, RepMero 81
            //pak.addHexBytes("000000000000000000178604E40008AF2F0175020000A39F714A81FF81FF81FF670067006700000003000301310000B402320000B403380000B4044E0000000200510000001600520000001900540000001300");
            pak.addUint32(marginCharacter.exp, 1);
            pak.addUint32(marginCharacter.cash, 1);
            pak.addUintShort(0x01); // Flag - always 1
            pak.addUint32(200, 1);  // CQ Points

            pak.addByteArray(TimeUtils.getCurrentTime());
            //pak.addByteArray(StringUtils.hexStringToBytes("875D714A")); // Last Changed Timestamp - current its static - needs to be dynamic

            // Rputation Bytes (int16[7])
            pak.addInt16(-116, 1);
            pak.addInt16(-117, 1);
            pak.addInt16(-20, 1);
            pak.addInt16(-59, 1);
            pak.addInt16(-58, 1);
            pak.addInt16(-57, 1);
            pak.addInt16(2, 1);
            pak.addByte(0x03);

            // 01 = onWorld , 00 = LA . In World you have to take care to not spawn the Character in LA State
            if (marginCharacter.districtId != 0)
            {
                pak.addByte(0x01);
            }
            else
            {
                pak.addByte(0x00);
            }

            pak.addHexBytes("0301310000b402320000b403380000b403510000000400520000000b00540000000100"); // The Last Part

                #if DEBUG
            if (isNewCreatedChar == true)
            {
                Output.WriteLine("Load Background Reply for Created Char:\n" + pak.returnFinalPacket());
            }
                        #endif

            return(pak.returnFinalPacket());
        }
예제 #24
0
 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());
 }
예제 #25
0
        // 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());
        }
예제 #26
0
        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());
        }
예제 #27
0
        public void sendJackoutEffect(WorldClient client)
        {
            PacketContent pak = new PacketContent();
            double        x = 0; double y = 0; double z = 0;

            byte[] Ltvector3d = client.playerInstance.Position.getValue();
            NumericalUtils.LtVector3dToDoubles(Ltvector3d, ref x, ref y, ref z);
            int   rotation = (int)client.playerInstance.YawInterval.getValue()[0];
            float xPos     = (float)x;
            float yPos     = (float)y;
            float zPos     = (float)z;

            pak.addUint16(2, 1); // ToDo: we should change this for other views ?
            pak.addHexBytes("032802C000740010");
            pak.addFloatLtVector3f(xPos, yPos, zPos);
            pak.addHexBytes("E93C991E8080808080801001000000"); // ToDo: analyze it more ?
            client.playerData.isJackoutInProgress = true;
            client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
        }
예제 #28
0
        public void createFlashTraffic(WorldClient client, string url)
        {
            PacketContent pak = new PacketContent();

            pak.addUint16((UInt16)RPCResponseHeaders.SERVER_FLASH_TRAFFIC, 0);
            pak.addHexBytes("0000070005");
            pak.addSizedString(url);
            pak.addByte(0);
            client.messageQueue.addRpcMessage(pak.returnFinalPacket());
        }
예제 #29
0
        // 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());
        }
예제 #30
0
        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();
        }
예제 #31
0
        // ToDo: Move it to player Packets and make a ?moa command for it
        public void sendChangeChangeMoaRSI(WorldClient client, byte[] rsi)
        {
            // ToDo: proove to remove
            PacketContent pak = new PacketContent();

            pak.addUint16(2, 1);
            pak.addHexBytes("0281008080808004");
            pak.addByteArray(rsi);
            pak.addByte(0x41);
            pak.addByte(0x00);
            client.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
        }
예제 #32
0
        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());
        }
예제 #33
0
        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();
        }
예제 #34
0
        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);
        }
예제 #35
0
        public static byte[] createSystemMessageWithoutRPC(string message)
        {
            byte[] messageBytes = StringUtils.stringToBytes(message + "\x00");


            UInt16 messageSize = (UInt16)(message.Length + 1);


            PacketContent packet = new PacketContent();

            packet.addUintShort((UInt16)RPCResponseHeaders.SERVER_CHAT_MESSAGE_RESPONSE);
            packet.addHexBytes("0700000000000000000024000000000000000000000000000000000000000000000000");
            packet.addUint16(messageSize, 1);
            packet.addByteArray(messageBytes);

            return(packet.returnFinalPacket());
        }
예제 #36
0
        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();
            }
        }
예제 #37
0
        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();
            }
        }
예제 #38
0
파일: ChatPackets.cs 프로젝트: hdneo/mxo-hd
        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());
        }
예제 #39
0
        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();
        }
예제 #40
0
 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());
 }
예제 #41
0
        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();
        }
예제 #42
0
 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());
 }
예제 #43
0
        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());
        }
예제 #44
0
        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());
                }
            }
        }