setRPCCounter() public méthode

public setRPCCounter ( UInt16 rpc ) : void
rpc System.UInt16
Résultat void
Exemple #1
0
        public void generateRpcMessageData()
        {
            // Example : 04 01 00 15 01 + submessages
            // Strcut: uint8 04 header + uint8 listcount + uint16 currentRPCCounter + submessageCounter (list1)
            // If you have 2 lists , the data struct is : uint8 submessagecount + submessages

            // TODO!!! FINALIZE!!
            // Here goes code from RPCPacket (As it should be generated on the fly)
            if (RPCMessages.Count > 0)
            {
                content.append((byte)ProtocolHeaders.RPC_PROTOCOL);
                // ToDo: Figure out what the "Lists" Count should handle ...maybe different types?
                // Why not having just one List and adding them all ? Maybe a list has a limit ?
                content.append(0x01); // List Count for RPC Messages
                Output.WriteLine(" RPC COUNTER BYTES :" + StringUtils.bytesToString(NumericalUtils.uint16ToByteArray(playerData.getRPCCounter(), 0)));
                content.append(NumericalUtils.uint16ToByteArray(playerData.getRPCCounter(), 0));
                content.append(NumericalUtils.uint16ToByteArrayShort((UInt16)RPCMessages.Count));
                foreach (SequencedMessage message in RPCMessages)
                {
                    content.append(message.content);
                }

                // Set new RPC Counter
                UInt16 incrementRpcCounter = playerData.getRPCCounter();
                Output.WriteDebugLog("Before RPC Counter :" + incrementRpcCounter.ToString());
                incrementRpcCounter += (ushort)RPCMessages.Count;
                playerData.setRPCCounter(incrementRpcCounter);
                Output.WriteDebugLog("After RPC Counter :" + incrementRpcCounter.ToString() + " (should added " + RPCMessages.Count.ToString() + ")");
            }
        }
Exemple #2
0
        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;
        }
Exemple #3
0
        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;
        }