/// <summary> /// Initializes a new instance of the <see cref="LoginHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public LoginHandler(IGameServerContext gameContext) { this.gameContext = gameContext; this.loginAction = new LoginAction(gameContext); this.logoutAction = new LogoutAction(gameContext); this.decryptor = new Xor3Decryptor(0); }
/// <summary> /// Initializes a new instance of the <see cref="GuildCache"/> class. /// </summary> /// <param name="gameServer">The game server.</param> /// <param name="serializer">The serializer.</param> public GuildCache(IGameServerContext gameServer, IGuildInfoSerializer serializer) { this.gameServer = gameServer; this.guildInfoSerializer = serializer; this.cache = new ConcurrentDictionary <Guid, GuildInfo>(); this.shortIdToGuid = new ConcurrentDictionary <ushort, Guid>(); }
/// <summary> /// Initializes a new instance of the <see cref="RemotePlayer"/> class. /// </summary> /// <param name="gameContext">The game context.</param> /// <param name="packetHandler">The packet handler.</param> /// <param name="connection">The remote connection.</param> public RemotePlayer(IGameServerContext gameContext, IPacketHandler packetHandler, IConnection connection) : base(gameContext) { this.Connection = connection; this.MainPacketHandler = packetHandler; this.Connection.PacketReceived += (sender, packet) => this.PacketReceived(packet); this.Connection.Disconnected += (sender, packet) => this.Disconnect(); }
/// <summary> /// Initializes a new instance of the <see cref="RemotePlayer"/> class. /// </summary> /// <param name="gameContext">The game context.</param> /// <param name="packetHandler">The packet handler.</param> /// <param name="connection">The remote connection.</param> public RemotePlayer(IGameServerContext gameContext, IPacketHandler packetHandler, IConnection connection) : base(gameContext, null) { this.PlayerView = new RemoteView(connection, this, gameContext, new AppearanceSerializer()); this.Connection = connection; this.MainPacketHandler = packetHandler; this.Connection.PacketReceived += (sender, packet) => this.PacketReceived(packet); this.Connection.Disconnected += (sender, packet) => this.Disconnect(); }
public override void Setup() { base.Setup(); this.guildMasterPlayer = this.CreateGuildMasterPlayer(); this.gameServerContext = this.CreateGameServer(); this.guildMasterPlayer.ShortGuildID = this.GuildServer.GuildMemberEnterGame(new Guid(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), this.GuildMaster.Name, 0); this.player = TestHelper.GetPlayer(); this.player.CurrentMap.Add(this.guildMasterPlayer); this.player.SelectedCharacter.Name = "Player"; }
/// <summary> /// Initializes a new instance of the <see cref="RemotePlayer"/> class. /// </summary> /// <param name="gameContext">The game context.</param> /// <param name="connection">The remote connection.</param> /// <param name="clientVersion">The expected client version of the connected player.</param> public RemotePlayer(IGameServerContext gameContext, IConnection connection, ClientVersion clientVersion) : base(gameContext) { this.Connection = connection; this.clientVersion = clientVersion; this.MainPacketHandler = new MainPacketHandlerPlugInContainer(this, gameContext.PlugInManager); this.MainPacketHandler.Initialize(); this.Connection.PacketReceived += (sender, packet) => this.PacketReceived(packet); this.Connection.Disconnected += (sender, packet) => this.Disconnect(); }
public override void Setup() { base.Setup(); this.gameServerContext = this.CreateGameServer(); this.guildMasterPlayer = TestHelper.GetPlayer(this.gameServerContext); this.guildMasterPlayer.SelectedCharacter !.Id = this.GuildMaster.Id; this.guildMasterPlayer.SelectedCharacter.Name = this.GuildMaster.Name; this.guildMasterPlayer.GuildStatus = this.GuildServer.PlayerEnteredGame(this.GuildMaster.Id, this.GuildMaster.Name, 0); this.guildMasterPlayer.Attributes ![Stats.Level] = 100;
public override void Setup() { base.Setup(); this.gameServerContext = this.CreateGameServer(); this.guildMasterPlayer = TestHelper.GetPlayer(this.gameServerContext); this.guildMasterPlayer.SelectedCharacter.Id = this.GuildMaster.Id; this.guildMasterPlayer.SelectedCharacter.Name = this.GuildMaster.Name; this.guildMasterPlayer.GuildStatus = this.GuildServer.PlayerEnteredGame(this.GuildMaster.Id, this.GuildMaster.Name, 0); this.player = TestHelper.GetPlayer(this.gameServerContext); this.player.CurrentMap.Add(this.guildMasterPlayer); this.player.SelectedCharacter.Name = "Player"; this.player.SelectedCharacter.Id = Guid.NewGuid(); }
/// <summary> /// Initializes a new instance of the <see cref="RemoteView"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="player">The player.</param> /// <param name="context">The context.</param> /// <param name="appearanceSerializer">The appearance serializer.</param> public RemoteView(IConnection connection, Player player, IGameServerContext context, IAppearanceSerializer appearanceSerializer) : base(connection) { this.context = context; this.itemSerializer = new ItemSerializer(); this.connection = connection; this.player = player; this.PartyView = new PartyView(connection, player); this.MessengerView = new MessengerView(connection, player, context.FriendServer, appearanceSerializer); this.TradeView = new TradeView(connection, player, this.itemSerializer); this.GuildView = new GuildView(connection, player); this.WorldView = new WorldView(connection, player, this.itemSerializer, appearanceSerializer); this.InventoryView = new InventoryView(connection, player, this.itemSerializer); this.appearanceSerializer = appearanceSerializer; this.lowestClientVersion = this.GetLowestClientVersionOfConfiguration(); }
/// <summary> /// Initializes a new instance of the <see cref="ChatRequestAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public ChatRequestAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="GuildListRequestAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildListRequestAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="LoginAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public LoginAction(IGameServerContext gameContext) { this.gameServerContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="AddFriendAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public AddFriendAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="ChatRoomInvitationRequest"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public ChatRoomInvitationRequest(IGameServerContext gameContext) { this.chatRequestAction = new ChatRequestAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildCache"/> class. /// </summary> /// <param name="gameServer">The game server.</param> /// <param name="serializer">The serializer.</param> public GuildCache(IGameServerContext gameServer, IGuildInfoSerializer serializer) { this.gameServer = gameServer; this.guildInfoSerializer = serializer; this.cache = new ConcurrentDictionary <uint, byte[]>(); }
/// <summary> /// Initializes a new instance of the <see cref="ChatRequestHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public ChatRequestHandler(IGameServerContext gameContext) { this.chatRequestAction = new ChatRequestAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="AddResponseAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public AddResponseAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurableMainPacketHandler" /> class. /// </summary> /// <param name="configuration">The configuration.</param> /// <param name="gameServer">The game server.</param> public ConfigurableMainPacketHandler(MainPacketHandlerConfiguration configuration, IGameServerContext gameServer) { this.configuration = configuration; using (var container = new UnityContainer()) { container.RegisterInstance(typeof(IGameServerContext), string.Empty, gameServer, new ExternallyControlledLifetimeManager()); container.RegisterInstance(typeof(IGameContext), string.Empty, gameServer, new ExternallyControlledLifetimeManager()); container.RegisterInstance(typeof(IFriendServer), string.Empty, gameServer.FriendServer, new ExternallyControlledLifetimeManager()); foreach (var handlerConfiguration in this.configuration.PacketHandlers) { this.CreateHandler(container, handlerConfiguration); } } }
/// <summary> /// Initializes a new instance of the <see cref="AddFriendHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public AddFriendHandler(IGameServerContext gameContext) { this.addAction = new AddFriendAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="ChangeOnlineStateHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public ChangeOnlineStateHandler(IGameServerContext gameContext) { this.changeAction = new ChangeOnlineStateAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildKickPlayerAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildKickPlayerAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="GuildRequestAnswerAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildRequestAnswerAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="GuildCreateHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildCreateHandler(IGameServerContext gameContext) { this.createAction = new GuildCreateAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildCreateAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildCreateAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="ChangeOnlineStateAction"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public ChangeOnlineStateAction(IGameServerContext gameContext) { this.gameContext = gameContext; }
/// <summary> /// Initializes a new instance of the <see cref="FriendAddResponseHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public FriendAddResponseHandler(IGameServerContext gameContext) { this.responseAction = new AddResponseAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildRequestAnswerHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildRequestAnswerHandler(IGameServerContext gameContext) { this.answerAction = new GuildRequestAnswerAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildInfoRequestHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildInfoRequestHandler(IGameServerContext gameContext) { this.requestAction = new GuildInfoRequestAction(gameContext); }
/// <summary> /// Initializes a new instance of the <see cref="GuildKickPlayerHandler"/> class. /// </summary> /// <param name="gameContext">The game context.</param> public GuildKickPlayerHandler(IGameServerContext gameContext) { this.kickAction = new GuildKickPlayerAction(gameContext); }