Example #1
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Combat_AttackStop)packet;

            abilityInstanceId = typedPacket.abilityInstanceId;
        }
Example #2
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (EntityPacket)packet;

            entityId = typedPacket.entityId;
        }
Example #3
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ServerConnectionHeader)packet;

            connectionId = typedPacket.connectionId;
        }
Example #4
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (LogoutClient)packet;

            clientConnectionId = typedPacket.clientConnectionId;
        }
Example #5
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (LoginCredentialValid)packet;

            isValid = typedPacket.isValid;
        }
Example #6
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ClientIdPacket)packet;

            Id = typedPacket.Id;
        }
Example #7
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ClientGameInfoResponse)packet;

            GameId = typedPacket.GameId;
        }
Example #8
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (CharacterFullPacket)packet;

            Name = typedPacket.Name;
        }
Example #9
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            NPC_BTState bts = packet as NPC_BTState;

            frameId = bts.frameId;
            guid.Copy(bts.guid);
        }
Example #10
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (UserAccountResponse)packet;

            socketId       = typedPacket.socketId;
            isValidAccount = typedPacket.isValidAccount;
        }
Example #11
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ProfileCreateCharacterResponse)packet;

            accountId   = typedPacket.accountId;
            characterId = typedPacket.characterId;
        }
Example #12
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ClientDisconnectPacket)packet;

            accountId    = typedPacket.accountId;
            connectionId = typedPacket.connectionId;
        }
Example #13
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (NPCFullPacket)packet;

            AgentID  = typedPacket.AgentID;
            ConfigID = typedPacket.ConfigID;
        }
Example #14
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            NPC_BlackBoard bbs = packet as NPC_BlackBoard;

            bbDelta = new byte[bbs.bbDelta.Length];
            Array.Copy(bbs.bbDelta, bbDelta, bbs.bbDelta.Length);
        }
Example #15
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (WorldEntityPacket)packet;

            position.CopyFrom(typedPacket.position);
            rotation.CopyFrom(typedPacket.rotation);
        }
Example #16
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Combat_BuffApply)packet;

            frameId = typedPacket.frameId;
            Array.Copy(typedPacket.buffIds, buffIds, buffIds.Length);
        }
Example #17
0
 virtual public void CopyFrom(BasePacket packet)
 {
     if (!packet.GetType().Equals(GetType()))
     {
         throw new Exception(String.Format("Cannot CopyFrom a different class.  Us: {0}, Them: {1}",
                                           GetType().FullName, packet.GetType().FullName));
     }
 }
Example #18
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (LoginCredentials)packet;

            playerName.Copy(typedPacket.playerName);
            password.Copy(typedPacket.password);
        }
Example #19
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Entity_MoveAway)packet;

            frameId  = typedPacket.frameId;
            awayFrom = typedPacket.awayFrom;
        }
Example #20
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Combat_StaminaChange)packet;

            frameId             = typedPacket.frameId;
            currentStaminaValue = typedPacket.currentStaminaValue;
        }
Example #21
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ServerTick)packet;

            TickCount             = typedPacket.TickCount;
            NumTicksSinceLastSend = typedPacket.NumTicksSinceLastSend;
        }
Example #22
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ServerIdPacket)packet;

            Id    = typedPacket.Id;
            MapId = typedPacket.MapId;
            Type  = typedPacket.Type;
        }
Example #23
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ProfileUpdateCharacter)packet;

            characterId = typedPacket.characterId;
            // TODO: Non-alloc version of this
            state = new PlayerSaveStateData();
            state.CopyFrom(typedPacket.state);
        }
Example #24
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (UserAccountRequest)packet;

            socketId     = typedPacket.socketId;
            username     = typedPacket.username;
            password     = typedPacket.password;
            product_name = typedPacket.product_name;
        }
Example #25
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Entity_MoveTo)packet;

            frameId             = typedPacket.frameId;
            destinationEntityId = typedPacket.destinationEntityId;
            movementType        = typedPacket.movementType;
            destination         = typedPacket.destination;
        }
Example #26
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (Combat_AttackRequest)packet;

            frameId   = typedPacket.frameId;
            abilityId = typedPacket.abilityId;
            targetId  = typedPacket.targetId;
            position  = typedPacket.position;
        }
Example #27
0
        public override void CopyFrom(BasePacket packet)
        {
            base.CopyFrom(packet);
            var typedPacket = (ProfileCreateCharacterRequest)packet;

            accountId     = typedPacket.accountId;
            productName   = typedPacket.productName;
            characterName = typedPacket.characterName;
            // TODO: Non-alloc version of this
            state = new PlayerSaveStateData();
            state.CopyFrom(typedPacket.state);
        }
Example #28
0
 public bool Deallocate(BasePacket packet)
 {
     try
     {
         pools[packet.PacketType].Free(packet);
         return(true);
     }
     catch
     {
         Console.WriteLine("memory pool problem");
     }
     return(false);
 }
Example #29
0
 public void Free(BasePacket bp)
 {
     if (bp.PacketType != type)
     {
         Console.WriteLine("Attempted to free an invalid packet type");
         //throw new InvalidOperationException("object pool problem");
     }
     if (bp.IsInPool)
     {
         Console.WriteLine("Packet already in the pool");
         //throw new InvalidOperationException("Packet already in the pool");
     }
     bp.IsInPool = true;
     bp.Dispose();
     lock (pool)
     {
         pool.Enqueue(bp);
     }
 }
Example #30
0
        bool RouteToGame(int gameId, int connectionId, BasePacket packet)
        {
            if (Type == ServerIdPacket.ServerType.Game)
            {
                // CS: Don't filter packets yet - we only get packets in here
                // once we're logged in, and we've got a valid gameId, so
                // we can, for the moment, just assume all packets go to the game server

                //if(packet.PacketType == PacketType.WorldEntity ||
                //    packet.PacketType == PacketType.CharacterFull ||
                //    packet.PacketType == PacketType.PlayerFull ||
                //    packet.PacketType == PacketType.PlayerSaveState
                //    )
                {
                    foreach (var socketWrapper in servers)
                    {
                        if (socketWrapper.gameId == gameId)
                        {
                            socketWrapper.AddConnection(connectionId);

                            ServerConnectionHeader header = (ServerConnectionHeader)IntrepidSerialize.TakeFromPool(PacketType.ServerConnectionHeader);
                            header.connectionId = connectionId;
                            socketWrapper.Send(header);

                            if (packet.PacketType == PacketType.ServerPingHopper)
                            {
                                string name = Assembly.GetCallingAssembly().GetName().Name;
                                (packet as ServerPingHopperPacket).Stamp(name + ": client to game");
                            }
                            socketWrapper.Send(packet);
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }