Beispiel #1
0
        internal GameSocket(ServerChildTcpSocket socket, GameSocketManager manager)
        {
            _internalSocket = socket;
            _lengthBuffer   = new byte[manager.Protocol.Reader.LengthBytes];

            GameSocketManager = manager;
            GameSocketManager.Protocol.HandlerInvokerManager[this] = new GameSocketMessageHandlerInvoker();

            Habbo = HabboDistributor.GetPreLoginHabbo(this);
        }
Beispiel #2
0
        public GameSocketManager NewGameSocketManager(string socketManagerName, IPAddress ipAddress, ushort port, GameSocketProtocol protocol)
        {
            GameSocketManager gameSocketManager = new GameSocketManager
            {
                Address = IPAddress.Any,
                Port = port,
                Protocol = protocol
            };

            CancelEventArgs args = new CancelEventArgs();
            OfficalEventFirer.Fire("gamesocketmanager_added", EventPriority.Before, gameSocketManager, args);

            if (args.Cancel)
                return null;

            GameSocketManagers.Add(socketManagerName, gameSocketManager);
            OfficalEventFirer.Fire("gamesocketmanager_added", EventPriority.Before, gameSocketManager, args);
            return gameSocketManager;
        }
 public GameSocketManagerEventArgs(GameSocketManager gameSocketManager, string socketManagerName)
 {
     GameSocketManager = gameSocketManager;
     Name = socketManagerName;
 }
Beispiel #4
0
        public GameSocketManager NewGameSocketManager(string socketManagerName, IPAddress ipAddress, ushort port, GameSocketProtocol protocol)
        {
            GameSocketManager gameSocketManager = new GameSocketManager
            {
                Address = IPAddress.Any,
                Port = port,
                Protocol = protocol
            };

            GameSocketManagerEventArgs eventArgs = new GameSocketManagerEventArgs(gameSocketManager, socketManagerName);
            OfficalEventFirer.Fire("gamesocket_manager_added:before", eventArgs);
            if (eventArgs.IsCancelled)
                return null;
            GameSocketManagers.Add(socketManagerName, gameSocketManager);
            OfficalEventFirer.Fire("gamesocket_manager_added:after", eventArgs);

            return gameSocketManager;
        }