addDoubleLtVector3d() public method

public addDoubleLtVector3d ( double x, double y, double z ) : void
x double
y double
z double
return void
Esempio n. 1
0
        public void SendHyperJumpUpdate(float xFromPos, float yFromPos, float zFromPos, float xDestPos, float yDestPos,
                                        float zDestPos, UInt32 startTime, UInt32 endTime)
        {
            // ToDo: make real repsonse
            PacketContent pak = new PacketContent();

            pak.addByte(0x02);
            pak.addByte(0x00);
            pak.addByte(0x03);
            pak.addByte(0x09);
            pak.addByte(0x08);
            pak.addByte(0x00);
            pak.addFloatLtVector3f(xFromPos, yFromPos, zFromPos);
            pak.addUint32(startTime, 1);
            pak.addByte(0x80);
            pak.addByte(0x80);
            pak.addByte(0xb8);
            pak.addByte(0x14); // if 0xb8
            pak.addByte(0x00); // if 0xb8
            pak.addUint32(endTime, 1);
            pak.addDoubleLtVector3d((double)xDestPos, (double)yDestPos, (double)zDestPos);
            pak.addByteArray(new byte[] { 0x10, 0xff, 0xff });
            pak.addByte(0x00);
            pak.addByte(0x00);
            pak.addByte(0x00);
            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), true);
        }
Esempio n. 2
0
        public void SendHyperJumpStepUpdate(LtVector3f currentPos, double xDestPos, double yDestPos, double zDestPos,
                                            float jumpHeight, uint endtime, ushort stepJumpId, uint maybeTimeBasedValue, bool isLastStep = false)
        {
            PacketContent pak = new PacketContent();

            pak.addUint16(2, 1);
            pak.addByte(0x03);
            pak.addByte(0x0d);
            pak.addByte(0x08);
            pak.addByte(0x00);
            pak.addUintShort(Store.currentClient.playerData.getJumpID());
            pak.addFloatLtVector3f(currentPos.x, currentPos.y, currentPos.z);
            pak.addUintShort(stepJumpId);
            pak.addUint32(maybeTimeBasedValue, 1);
            // ToDo: Insert 2 missing bytes (or 4 as the next 2 bytes MAYBE wrong)
            pak.addByte(0x8a);
            pak.addByte(0x04);
            pak.addByte(0x80);
            pak.addByte(0x88);
            pak.addByteArray(new byte[] { 0x00, 0x00, 0x00, 0x00, 0xbc });
            pak.addFloat(jumpHeight, 1);
            pak.addUint16(4, 1);
            pak.addUint32(endtime, 1);
            pak.addDoubleLtVector3d(xDestPos, yDestPos, zDestPos);
            pak.addByteArray(new byte[] { 0x80, 0x81, 0x00, 0x02 });
            if (isLastStep)
            {
                pak.addByte(0x00);
                Store.currentClient.playerData.isJumping = false;
            }
            else
            {
                pak.addByte(0x01);
            }

            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
            Store.currentClient.FlushQueue();
        }
Esempio n. 3
0
        public void SendHyperJumpStepUpdate(LtVector3f currentPos, double xDestPos, double yDestPos, double zDestPos, float jumpHeight, UInt32 endtime)
        {
            PacketContent pak = new PacketContent();

            pak.addUint16(2, 1);
            pak.addByte(0x03);
            pak.addByte(0x0d);
            pak.addByte(0x08);
            pak.addByte(0x00);
            pak.addFloatLtVector3f(currentPos.x, currentPos.y, currentPos.z);
            pak.addByte(0x8a);
            pak.addByte(0x04);
            pak.addByte(0x80);
            pak.addByte(0x88);
            pak.addByteArray(new byte[] { 0x00, 0x00, 0x00, 0x00, 0xbc });
            pak.addFloat(jumpHeight, 1);
            pak.addUint16(4, 1);
            pak.addUint32(endtime, 1);
            pak.addDoubleLtVector3d(xDestPos, yDestPos, zDestPos);
            pak.addByteArray(new byte[] { 0x80, 0x81, 0x00, 0x02, 0x01, 0x00 });
            Store.currentClient.messageQueue.addObjectMessage(pak.returnFinalPacket(), false);
            Store.currentClient.FlushQueue();
        }
        public void processOpenDoor(StaticWorldObject door)
        {
            UInt16 typeId = NumericalUtils.ByteArrayToUint16(door.type, 1);

            byte[] masterViewId = { 0x01, 0x00 };
            byte[] seperator    = { 0xcd, 0xab };

            Store.currentClient.playerData.newViewIdCounter++; // It is just for a test Later we will change this to have a List with Views and Object IDs

            byte[] disarmDifficultyMaybe = { 0x03, 0x84 };
            byte[] endViewID             = { 0x00, 0x00 };

            byte[] spawnCounter = NumericalUtils.uint16ToByteArrayShort(Store.currentClient.playerData.assignSpawnIdCounter());
            Output.WriteLine("[DOOR]POS X : " + door.pos_x.ToString() + " POS Y: " + door.pos_y.ToString() + " POS Z: " + door.pos_z.ToString() + ", TypeId: " + StringUtils.bytesToString_NS(door.type));

            switch (typeId)
            {
            case 417:
            case 419:
                // ToDo: Packet Format for Elevator
                // 02 03 01 00
                // 08
                // a3 01
                // 6b 01 f0 3d be
                // cd ab 03 88 00 00 00 00 ff ff 7f 3f 00 00 00 00 f3 04 35 33
                // 22 00 00 00 00 40 f4 fb 40 00 00 00 00 00 90 75 40 00 00 00 00 00 40 af 40 ff ff ff ff 19 00 00
                // 11 00 01 00 04 61 97 e1 47 f0 bf 2d 44 de 30 35 45 00 00
                PacketContent content = new PacketContent();
                content.addByteArray(masterViewId);
                content.addByte(0x08);
                content.addByteArray(door.type);
                content.addByteArray(NumericalUtils.uint32ToByteArray(door.mxoId, 1));
                content.addByteArray(spawnCounter);                            // Spawn Object Counter
                content.addByteArray(seperator);
                content.addByte(0x03);                                         // Number of Attributes to parse (3)
                content.addByte(0x88);                                         // GROUP 1 - more groups ON, Attribute 4 (305,Orientation,LTQuaternion,16) SET (10001000)
                content.addByteArray(StringUtils.hexStringToBytes(door.quat)); // ToDo: replace it later with the real LTQuaternion
                content.addByte(0x22);                                         // GROUP 2 - more groups OFF, Attribute 2,6  SET (00100010)
                content.addDoubleLtVector3d(door.pos_x, door.pos_y, door.pos_z);
                content.addByteArray(new byte[] { 0xff, 0xff, 0xff, 0xff });
                content.addByteArray(NumericalUtils.uint16ToByteArray(Store.currentClient.playerData.newViewIdCounter, 1));
                content.addByteArray(endViewID);
                content.addByte(0x00);
                Store.currentClient.messageQueue.addObjectMessage(content.returnFinalPacket(), false);
                break;

            case 2506:
                // ToDo: Packet Format for Elevator


                break;

            default:

                PacketContent contentDefault = new PacketContent();
                contentDefault.addByteArray(masterViewId);
                contentDefault.addByte(0x08);
                contentDefault.addByteArray(door.type);
                contentDefault.addByteArray(NumericalUtils.uint32ToByteArray(door.mxoId, 1));
                contentDefault.addByteArray(spawnCounter);     // Spawn Object Counter
                contentDefault.addByteArray(seperator);
                contentDefault.addByteArray(disarmDifficultyMaybe);
                contentDefault.addByte(0x00);                                                                  // isZionAligned?
                contentDefault.addByteArray(StringUtils.hexStringToBytes("0000000000803F000000000000000041")); // ToDo: replace it later with the real values from the object
                contentDefault.addDoubleLtVector3d(door.pos_x, door.pos_y, door.pos_z);
                contentDefault.addByteArray(StringUtils.hexStringToBytes("34080000"));
                contentDefault.addByteArray(NumericalUtils.uint16ToByteArray(Store.currentClient.playerData.newViewIdCounter, 1));
                contentDefault.addByteArray(endViewID);
                contentDefault.addByte(0x00);
                Store.currentClient.messageQueue.addObjectMessage(contentDefault.returnFinalPacket(), false);
                break;
            }
        }