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