コード例 #1
0
        private bool handleClientUpdate(Kaminari.IMarshal marshal, Kaminari.PacketReader packet, IClient client, ushort blockId)
        {
            if (Overflow.leq(blockId, clientUpdateLastCalled))
            {
                // TODO: Returning true here means the packet is understood as correctly parsed, while we are ignoring it
                return(true);
            }
            var data = emplaceData(clientUpdate, blockId, packet.timestamp());

            if (!data.unpack(marshal, packet))
            {
                return(false);
            }
            // The user is assumed to provide all peek methods in C#
            // TODO: Test if the method exists in the class
            return(client.peekClientUpdate(data, packet.timestamp()));
        }
コード例 #2
0
        private bool handleLoginCharacter(Kaminari.IMarshal marshal, Kaminari.PacketReader packet, IClient client, ushort blockId)
        {
            if (!client.check(client, "status", ingame_status::login_done))
            {
                return(client.handleClientError(client, packet.getOpcode()));
            }
            if (Overflow.leq(blockId, loginCharacterLastCalled))
            {
                // TODO: Returning true here means the packet is understood as correctly parsed, while we are ignoring it
                return(true);
            }
            var data = emplaceData(loginCharacter, blockId, packet.timestamp());

            if (!data.unpack(marshal, packet))
            {
                return(false);
            }
            // The user is assumed to provide all peek methods in C#
            // TODO: Test if the method exists in the class
            return(client.peekLoginCharacter(data, packet.timestamp()));
        }