コード例 #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);
        }
コード例 #2
0
ファイル: ServerCore.cs プロジェクト: habb0/Bluedot
        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;
        }
コード例 #3
0
 public GameSocketManagerEventArgs(GameSocketManager gameSocketManager, string socketManagerName)
 {
     GameSocketManager = gameSocketManager;
     Name = socketManagerName;
 }
コード例 #4
0
ファイル: ServerCore.cs プロジェクト: habb0/IHI-1
        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;
        }