Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
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>();
 }
Ejemplo n.º 3
0
 /// <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();
 }
Ejemplo n.º 4
0
 /// <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();
 }
Ejemplo n.º 5
0
 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";
 }
Ejemplo n.º 6
0
 /// <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();
 }
Ejemplo n.º 7
0
        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;
Ejemplo n.º 8
0
        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();
        }
Ejemplo n.º 9
0
 /// <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();
 }
Ejemplo n.º 10
0
 /// <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;
 }
Ejemplo n.º 11
0
 /// <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;
 }
Ejemplo n.º 12
0
 /// <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;
 }
Ejemplo n.º 13
0
 /// <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;
 }
Ejemplo n.º 14
0
 /// <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);
 }
Ejemplo n.º 15
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 <uint, byte[]>();
 }
Ejemplo n.º 16
0
 /// <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);
 }
Ejemplo n.º 17
0
 /// <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;
 }
Ejemplo n.º 18
0
 /// <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);
         }
     }
 }
Ejemplo n.º 19
0
 /// <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);
 }
Ejemplo n.º 20
0
 /// <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);
 }
Ejemplo n.º 21
0
 /// <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;
 }
Ejemplo n.º 22
0
 /// <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;
 }
Ejemplo n.º 23
0
 /// <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);
 }
Ejemplo n.º 24
0
 /// <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;
 }
Ejemplo n.º 25
0
 /// <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;
 }
Ejemplo n.º 26
0
 /// <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);
 }
Ejemplo n.º 27
0
 /// <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);
 }
Ejemplo n.º 28
0
 /// <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);
 }
Ejemplo n.º 29
0
 /// <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);
 }