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); }
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; }
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; }