private void Login_NetClient_Disconnected(object sender, SocketError e) { Log.Warn("Disconnected (login socket)!"); if (e != 0) { Characters = null; DisposeAllServerEntries(); if (Settings.GlobalSettings.Reconnect) { Reconnect = true; PopupMessage = string.Format(ResGeneral.ReconnectPleaseWait01, _reconnectTryCounter, StringHelper.AddSpaceBeforeCapital(e.ToString())); UIManager.GetGump <LoadingGump>()?.SetText(PopupMessage); } else { PopupMessage = string.Format(ResGeneral.ConnectionLost0, StringHelper.AddSpaceBeforeCapital(e.ToString())); } CurrentLoginStep = LoginSteps.PopUpMessage; } }
private void Login_NetClient_Disconnected(object sender, SocketError e) { Log.Warn("Disconnected (login socket)!"); if (e > 0) { Characters = null; Servers = null; if (Settings.GlobalSettings.Reconnect) { Reconnect = true; PopupMessage = $"Reconnect, please wait...`{_reconnectTryCounter}`\n`{StringHelper.AddSpaceBeforeCapital(e.ToString())}`"; var c = UIManager.Gumps.OfType <LoadingGump>().FirstOrDefault(); if (c != null) { c._Label.Text = PopupMessage; } } else { PopupMessage = $"Connection lost:\n`{StringHelper.AddSpaceBeforeCapital(e.ToString())}`"; } CurrentLoginStep = LoginSteps.PopUpMessage; } }
private void SocketOnDisconnected(object sender, SocketError e) { if (Settings.GlobalSettings.Reconnect) { _forceStopScene = true; } else { UIManager.Add ( new MessageBoxGump ( 200, 200, string.Format(ResGeneral.ConnectionLost0, StringHelper.AddSpaceBeforeCapital(e.ToString())), s => { if (s) { Client.Game.SetScene(new LoginScene()); } } ) ); } }
private void NetClient_Disconnected(object sender, SocketError e) { Log.Warn("Disconnected (game socket)!"); if (CurrentLoginStep == LoginSteps.CharacterCreation) { return; } Characters = null; DisposeAllServerEntries(); PopupMessage = string.Format(ResGeneral.ConnectionLost0, StringHelper.AddSpaceBeforeCapital(e.ToString())); CurrentLoginStep = LoginSteps.PopUpMessage; }
private void NetClient_Disconnected(object sender, SocketError e) { Log.Warn("Disconnected (game socket)!"); if (CurrentLoginStep == LoginSteps.CharacterCreation) { return; } Characters = null; Servers = null; PopupMessage = $"Connection lost:\n{StringHelper.AddSpaceBeforeCapital(e.ToString())}"; CurrentLoginStep = LoginSteps.PopUpMessage; }
public string CreateReagentListString(string separator) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < Regs.Length; i++) { switch (Regs[i]) { // britanian reagents case Reagents.BlackPearl: sb.Append(ResGeneral.BlackPearl); break; case Reagents.Bloodmoss: sb.Append(ResGeneral.Bloodmoss); break; case Reagents.Garlic: sb.Append(ResGeneral.Garlic); break; case Reagents.Ginseng: sb.Append(ResGeneral.Ginseng); break; case Reagents.MandrakeRoot: sb.Append(ResGeneral.MandrakeRoot); break; case Reagents.Nightshade: sb.Append(ResGeneral.Nightshade); break; case Reagents.SulfurousAsh: sb.Append(ResGeneral.SulfurousAsh); break; case Reagents.SpidersSilk: sb.Append(ResGeneral.SpidersSilk); break; // pagan reagents case Reagents.BatWing: sb.Append(ResGeneral.BatWing); break; case Reagents.GraveDust: sb.Append(ResGeneral.GraveDust); break; case Reagents.DaemonBlood: sb.Append(ResGeneral.DaemonBlood); break; case Reagents.NoxCrystal: sb.Append(ResGeneral.NoxCrystal); break; case Reagents.PigIron: sb.Append(ResGeneral.PigIron); break; default: if (Regs[i] < Reagents.None) { sb.Append(StringHelper.AddSpaceBeforeCapital(Regs[i].ToString())); } break; } if (i < Regs.Length - 1) { sb.Append(separator); } } return(sb.ToString()); }
public string CreateReagentListString(string separator) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < Regs.Length; i++) { switch (Regs[i]) { // britanian reagents case Reagents.BlackPearl: sb.Append("Black Pearl"); break; case Reagents.Bloodmoss: sb.Append("Bloodmoss"); break; case Reagents.Garlic: sb.Append("Garlic"); break; case Reagents.Ginseng: sb.Append("Ginseng"); break; case Reagents.MandrakeRoot: sb.Append("Mandrake Root"); break; case Reagents.Nightshade: sb.Append("Nightshade"); break; case Reagents.SulfurousAsh: sb.Append("Sulfurous Ash"); break; case Reagents.SpidersSilk: sb.Append("Spiders Silk"); break; // pagan reagents case Reagents.BatWing: sb.Append("Bat Wing"); break; case Reagents.GraveDust: sb.Append("Grave Dust"); break; case Reagents.DaemonBlood: sb.Append("Daemon Blood"); break; case Reagents.NoxCrystal: sb.Append("Nox Crystal"); break; case Reagents.PigIron: sb.Append("Pig Iron"); break; default: if (Regs[i] < Reagents.None) sb.Append(StringHelper.AddSpaceBeforeCapital(Regs[i].ToString())); else sb.Append("Unknown reagent"); break; } if (i < Regs.Length - 1) sb.Append(separator); } return sb.ToString(); }