This commit is contained in:
Michael 2017-05-28 14:40:42 -04:00
parent 6123e06842
commit 9914c18456
6 changed files with 45 additions and 59 deletions

View file

@ -232,6 +232,7 @@ namespace ShiftOS.WinForms.Applications
var text = txt.Lines.ToArray();
var text2 = text[text.Length - 1];
var text3 = "";
Console.WriteLine();
var text4 = Regex.Replace(text2, @"\t|\n|\r", "");
if (IsInRemoteSystem == true)

View file

@ -64,6 +64,9 @@ namespace ShiftOS.WinForms.Controls
public void Write(string text)
{
this.HideSelection = true;
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
this.SelectionFont = ConstructFont();
this.AppendText(Localization.Parse(text));
this.HideSelection = false;
}
@ -85,6 +88,9 @@ namespace ShiftOS.WinForms.Controls
{
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
this.HideSelection = true;
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
this.SelectionFont = ConstructFont();
this.Select(this.TextLength, 0);
this.AppendText(Localization.Parse(text) + Environment.NewLine);
this.HideSelection = false;

View file

@ -207,19 +207,19 @@ namespace ShiftOS.WinForms.Tools
if (ctrl is Button)
{
Button b = ctrl as Button;
if (!b.Tag.ToString().ToLower().Contains("keepbg"))
if (!tag.Contains("keepbg"))
{
b.BackColor = SkinEngine.LoadedSkin.ButtonBackgroundColor;
b.BackgroundImage = SkinEngine.GetImage("buttonidle");
b.BackgroundImageLayout = SkinEngine.GetImageLayout("buttonidle");
}
b.FlatAppearance.BorderSize = SkinEngine.LoadedSkin.ButtonBorderWidth;
if (!b.Tag.ToString().ToLower().Contains("keepfg"))
if (!tag.Contains("keepfg"))
{
b.FlatAppearance.BorderColor = SkinEngine.LoadedSkin.ButtonForegroundColor;
b.ForeColor = SkinEngine.LoadedSkin.ButtonForegroundColor;
}
if (!b.Tag.ToString().ToLower().Contains("keepfont"))
if (!tag.Contains("keepfont"))
b.Font = SkinEngine.LoadedSkin.ButtonTextFont;
Color orig_bg = b.BackColor;

View file

@ -153,50 +153,50 @@ namespace ShiftOS.Engine
}
}
if (defaultConf.ConnectToMud == true)
bool guidReceived = false;
ServerManager.GUIDReceived += (str) =>
{
bool guidReceived = false;
ServerManager.GUIDReceived += (str) =>
{
//Connection successful! Stop waiting!
guidReceived = true;
Console.WriteLine("[inetd] Connection successful.");
};
Console.WriteLine("[inetd] Connection successful.");
};
try
{
ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort);
//This haults the client until the connection is successful.
while (ServerManager.thisGuid == new Guid())
{
Thread.Sleep(10);
}
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
FinishBootstrap();
}
catch (Exception ex)
{
//No errors, this never gets called.
Console.WriteLine("[inetd] SEVERE: " + ex.Message);
Thread.Sleep(3000);
ServerManager.StartLANServer();
while (ServerManager.thisGuid == new Guid())
{
Thread.Sleep(10);
}
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
FinishBootstrap();
}
}
else
try
{
ServerManager.StartLANServer();
ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort);
//This haults the client until the connection is successful.
while (ServerManager.thisGuid == new Guid())
{
Thread.Sleep(10);
}
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
FinishBootstrap();
}
catch (Exception ex)
{
//No errors, this never gets called.
Console.WriteLine("[inetd] SEVERE: " + ex.Message);
Thread.Sleep(3000);
Console.WriteLine("[sys] SEVERE: Cannot connect to server. Shutting down in 5...");
Thread.Sleep(1000);
Console.WriteLine("[sys] 4...");
Thread.Sleep(1000);
Console.WriteLine("[sys] 3...");
Thread.Sleep(1000);
Console.WriteLine("[sys] 2...");
Thread.Sleep(1000);
Console.WriteLine("[sys] 1...");
Thread.Sleep(1000);
Console.WriteLine("[sys] Bye bye.");
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
//Nothing happens past this point - but the client IS connected! It shouldn't be stuck in that while loop above.
}));
thread.IsBackground = true;
thread.Start();

View file

@ -316,23 +316,6 @@ Ping: {ServerManager.DigitalSocietyPing} ms
private static bool singleplayer = false;
public static bool IsSingleplayer { get { return singleplayer; } }
public static void StartLANServer()
{
singleplayer = true;
ShiftOS.Server.Program.ServerStarted += (address) =>
{
Console.WriteLine($"Connecting to {address}...");
Initiate(address, 13370);
};
Disconnected += () =>
{
ShiftOS.Server.Program.Stop();
};
ShiftOS.Server.Program.Main(new[] { "" });
}
/// <summary>
/// Occurs when the server sends a message to this client.
/// </summary>

View file

@ -162,10 +162,6 @@
<Project>{A069089A-8962-4607-B2B2-4CF4A371066E}</Project>
<Name>ShiftOS.Objects</Name>
</ProjectReference>
<ProjectReference Include="..\ShiftOS.Server\ShiftOS.Server.csproj">
<Project>{226C63B4-E60D-4949-B4E7-7A2DDBB96776}</Project>
<Name>ShiftOS.Server</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<COMReference Include="MediaPlayer">