public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (Combat_AttackStop)packet; abilityInstanceId = typedPacket.abilityInstanceId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (EntityPacket)packet; entityId = typedPacket.entityId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ServerConnectionHeader)packet; connectionId = typedPacket.connectionId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (LogoutClient)packet; clientConnectionId = typedPacket.clientConnectionId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (LoginCredentialValid)packet; isValid = typedPacket.isValid; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ClientIdPacket)packet; Id = typedPacket.Id; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ClientGameInfoResponse)packet; GameId = typedPacket.GameId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (CharacterFullPacket)packet; Name = typedPacket.Name; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); NPC_BTState bts = packet as NPC_BTState; frameId = bts.frameId; guid.Copy(bts.guid); }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (UserAccountResponse)packet; socketId = typedPacket.socketId; isValidAccount = typedPacket.isValidAccount; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ProfileCreateCharacterResponse)packet; accountId = typedPacket.accountId; characterId = typedPacket.characterId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ClientDisconnectPacket)packet; accountId = typedPacket.accountId; connectionId = typedPacket.connectionId; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (NPCFullPacket)packet; AgentID = typedPacket.AgentID; ConfigID = typedPacket.ConfigID; }
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); }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (WorldEntityPacket)packet; position.CopyFrom(typedPacket.position); rotation.CopyFrom(typedPacket.rotation); }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (Combat_BuffApply)packet; frameId = typedPacket.frameId; Array.Copy(typedPacket.buffIds, buffIds, buffIds.Length); }
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)); } }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (LoginCredentials)packet; playerName.Copy(typedPacket.playerName); password.Copy(typedPacket.password); }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (Entity_MoveAway)packet; frameId = typedPacket.frameId; awayFrom = typedPacket.awayFrom; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (Combat_StaminaChange)packet; frameId = typedPacket.frameId; currentStaminaValue = typedPacket.currentStaminaValue; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ServerTick)packet; TickCount = typedPacket.TickCount; NumTicksSinceLastSend = typedPacket.NumTicksSinceLastSend; }
public override void CopyFrom(BasePacket packet) { base.CopyFrom(packet); var typedPacket = (ServerIdPacket)packet; Id = typedPacket.Id; MapId = typedPacket.MapId; Type = typedPacket.Type; }
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); }
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; }
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; }
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; }
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); }
public bool Deallocate(BasePacket packet) { try { pools[packet.PacketType].Free(packet); return(true); } catch { Console.WriteLine("memory pool problem"); } return(false); }
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); } }
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); }