/// <summary> /// 接收消息后,执行操作 /// </summary> public new void Do(ref bool flag) { if (this.SubMessageId == id_sd) { AnnounceHandler.Deal(this); } }
public async Task ShouldBroadcastMessageToGroup( [Frozen] Mock <IConnectedClientStore> connectedClients, ConnectedClient sender, Announce announce, CancellationToken ct, AnnounceHandler sut) { var connections = Fixture.CreateMany <IConnection>().ToList(); var clients = connections .Select(connection => CreateSingleGroupClient(connection)) .ToList(); connectedClients .Setup(x => x.FindInGroups(It.Is <IEnumerable <string> >( groups => groups.Count() == 1 && groups.Contains(sender.Group)))) .Returns(clients); await sut.HandleAsync(sender, announce, ct); foreach (var connection in connections) { Mock.Get(connection).Verify(x => x.SendAsync( It.Is <Announce>(m => m.Message.Contains(announce.Message)), ct)); } }
public AdminCore() { //TODO: check EnableRuntime before creating these objects to save memory Database = new SQLHandler(this); Server = new ServerManager(this); WebAdmin = new WebServer(this); Rcon = new RconClient(this); Players = new PlayerHandler(this); Announce = new AnnounceHandler(this); Game = new GameHandler(this); Commands = new CommandDispatcher(this); Mods = new LvlWriter(this); Plugins = new PluginManager(this); }
public EngineServiceProtocol(String name, String path, Graphic graphic, Model model, LogMessageHandler logMessageHandler, StateChangedHandler stateChangedHandler, RequestPortInfoHandler requestPortInfoHandler, AnnounceHandler announceHandler, RenounceHandler renounceHandler) { this.Name = name; this.Path = path; this.graphic = graphic; this.model = model; this.logMessageHandler = logMessageHandler; this.stateChangedHandler = stateChangedHandler; this.requestPortInfoHandler = requestPortInfoHandler; this.announceHandler = announceHandler; this.renounceHandler = renounceHandler; }
public ClientServiceProtocol(String name, String path, LoadHandler loadHandler, SaveHandler saveHandler, SaveAsHandler saveAsHandler, Graphic graphic, Model model, ChangePermissionsHandler clientChangePermissions, GetPropertyValuesHandler getPropertyValuesHandler, GetSubTagsHandler getSubTagsHandler, ChangeHandler changeHandler, RequestPortInfoHandler requestPortInfoHandler, PropertyListHandler propertyListHandler, LogMessageHandler logMessageHandler, AnnounceHandler announceHandler, RenounceHandler renounceHandler) { this.Name = name; this.Path = path; this.graphic = graphic; this.model = model; this.loadHandler = loadHandler; this.saveHandler = saveHandler; this.saveAsHandler = saveAsHandler; this.clientChangePermissions = clientChangePermissions; this.getPropertyValuesHandler = getPropertyValuesHandler; this.getSubTagsHandler = getSubTagsHandler; this.changeHandler = changeHandler; this.requestPortInfoHandler = requestPortInfoHandler; this.propertyListHandler = propertyListHandler; this.logMessageHandler = logMessageHandler; this.announceHandler = announceHandler; this.renounceHandler = renounceHandler; }