/// <summary> /// 创建Server服务器,地址绑定成功后,使用PubSocket发布出去ServerReady信息, /// 客户端的SubSocket接收到信息后,开始链接Server服务器 /// /// </summary> void WarBegin() { //War Data Model is passed by Lua(what ever) IWarModel warModel = new DebugModel(); warInfo = new WarInfo() { warMo = WarMode.NativeWar, #if Server Side = WarSide.ServerAndClient, RequiredClientCount = 2, Map = warModel.getMap(), Charactor = warModel.getCharactor(WarCamp.FirstCamp), ServerIp = "127.0.0.1", #else Side = WarSide.OnlyClient, Charactor = warModel.getCharactor(WarCamp.SecondCamp), ServerIp = "192.168.1.176", //TODO : real ip (not loopback) #endif }; if (warInfo.Side == WarSide.ServerAndClient) //启动server { Server = new RealServer(warInfo, ServerRepOk, ServerPubOK); } else //启动client , 这个client不和服务器端在一个物理设备上 { Client = new RealClient(warInfo); } }
/// <summary> /// ファイルにセーブ /// </summary> public static void SaveFile() { try { if (cached_instances.Count == 0) { return; } lock (_sync) { using (var stream = new FileStream(SettingPath.Current, FileMode.Create, FileAccess.ReadWrite)) using (var writer = new StreamWriter(stream, Encoding.UTF8)) { SettingsRoot root = new SettingsRoot { Keys = cached_instances.Keys.ToArray(), Values = cached_instances.Values.ToArray() }; var serializer = new XmlSerializer(typeof(SettingsRoot)); serializer.Serialize(writer, root); writer.Flush(); } } } catch (Exception ex) { DebugModel.WriteLine(ex); } }
public void AddDebugInfo(string origin, string msg) { if (ReferenceEquals(debugModel, null)) { debugModel = new DebugModel(); } debugModel.Origin = origin; debugModel.Text = msg; debugList.Add(debugModel); }
public void Initialize() { DebugModel.WriteLine("KanburaLike Init"); SettingsHost.LoadFile(); infovm = new ViewModels.InformationWindowViewModel(nameof(Views.InformationWindow)); info = new Views.InformationWindow { DataContext = infovm }; }
public void Dispose() { if (info.IsVisible == true) { info.Close(); } SettingsHost.SaveFile(); //DebugModel.Dump(infovm.Info.Brilliant.Ships.FirstOrDefault().Ship, nameof(infovm.Info.Brilliant)); DebugModel.WriteLine("KanburaLike Dispose"); }
/// <summary> /// 艦これが始まったときに呼ばれる /// </summary> private void Register() { Messenger.Raise(new InteractionMessage("InfoShow")); //母港情報 this.Homeport = new HomeportViewModel(); RaisePropertyChanged(nameof(Homeport)); //任務 this.Quests = new QuestsViewModel(); RaisePropertyChanged(nameof(Quests)); DebugModel.WriteLine("艦これ Start"); }
public async Task <ActionResult> IndexSubmit(DebugModel model) { if (model.SquareWebookTransactionId != null) { try { await SquareMicroService.ProcessWebhookPayloadAsync(model.SquareWebookTransactionId.Value); } catch (Exception ex) { AddFeedbackMessage(FeedbackMessageTypes.Error, ex.ToString()); } } model = ModelFactory.CreateDebugModel(ApplicationOptions.CurrentValue); return(View("Index", model)); }
public DebugViewModel() { debugModel = new DebugModel(); debugModel.PropertyChanged += DebugModel_PropertyChanged; Items3 = CreateData(); }