예제 #1
0
파일: WorldClient.cs 프로젝트: hdneo/mxo-hd
        public WorldClient(EndPoint _Remote, Socket _socket,string _key)
        {
            Remote = _Remote;
            socket = _socket;
            key = _key;
            cypher = new WorldEncryption();

            messageQueue = new MessageQueue();

            // Create the mpm structure for all world usage

            playerData = new ClientData();
            viewMan = new ViewManager();

            playerData.setUniqueKey(key);
            playerData.setRPCCounter((UInt16)0); //not hardcoded, RPC server system its AWESOME now!
            playerInstance = Store.world.objMan.GetAssignedObject(key);

            alive = true;
            deadSignals=0;
        }
예제 #2
0
 public WorldPacket(ClientData _playerData)
 {
     this.playerData = _playerData;
 }
예제 #3
0
파일: WorldPacket.cs 프로젝트: hdneo/mxo-hd
 public WorldPacket(ClientData _playerData)
 {
     this.playerData = _playerData;
 }
예제 #4
0
파일: WorldPacket.cs 프로젝트: hdneo/mxo-hd
        public byte[] getFinalData(ClientData playerData)
        {
            // TODO: Sim Time with Client (not real time) on every 4 Local SSEQ we send

            playerData.IncrementSseq();
            this.neededAckSSeq = playerData.getSseq();

            if ((NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(), 1) - playerData.lastSimTimeUpdate) > 3)
            {
                timed = true;
                playerData.lastSimTimeUpdate = NumericalUtils.ByteArrayToUint32(TimeUtils.getCurrentSimTime(),1);
            }

            playerData.getRPCShutDown();
            if (timed)
            {

                if (playerData.waitForRPCShutDown==true)
                {
                    content.append((byte)0xc2);
                }
                else
                {
                    content.append((byte)0x82);
                }

                content.append(TimeUtils.getCurrentSimTime());
            }
            else
            {

                if (playerData.waitForRPCShutDown == true)
                {
                    content.append((byte)0x42);
                }
                else
                {
                    content.append((byte)0x02);
                }

            }

            // Merge all Message together and generate the Final Packet Header
            generateObjectMessageData();
            generateRpcMessageData();
            Output.WriteDebugLog("PACKET DATA (getFinalData):" + StringUtils.bytesToString(content.getBytes()));
            return content.getBytes();
        }