mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-12 00:38:48 -07:00
Add files via upload
This commit is contained in:
parent
5a1ed9e2f9
commit
1bfbc75d36
51
src/Util/ConsoleFunctions.cs
Normal file
51
src/Util/ConsoleFunctions.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace sodoff.Utils;
|
||||
|
||||
public class ConsoleFunctions {
|
||||
//function to log when the server start and when the server is ready
|
||||
public static void log(string Option) {
|
||||
if (Option == "Server Start")
|
||||
{
|
||||
Console.WriteLine("Server is starting");
|
||||
}
|
||||
else if (Option == "Server Running")
|
||||
{
|
||||
Console.WriteLine("Server is running");
|
||||
Console.WriteLine("You can start the game now");
|
||||
Console.WriteLine("Press Ctrl + C to close the server");
|
||||
}
|
||||
}
|
||||
// asks if user wants to automally open the game
|
||||
public static void prompt(string GamePath)
|
||||
{
|
||||
string key;
|
||||
//asks the user if the game client should be automally opened
|
||||
Console.WriteLine("Do you want to open the game");
|
||||
Console.WriteLine("Y/n");
|
||||
//reads the user input
|
||||
key = Console.ReadLine();
|
||||
//allows uppercase
|
||||
key.ToUpper();
|
||||
//checks for y in string then automally opens the game client
|
||||
if (key.StartsWith("y"))
|
||||
{
|
||||
//checks if GamePath isnt null to prevend errors
|
||||
if (GamePath != null)
|
||||
{
|
||||
//starts the game automally
|
||||
Console.WriteLine("Opening game");
|
||||
Process.Start(GamePath);
|
||||
}
|
||||
}
|
||||
//if user wants to open the game manually
|
||||
else
|
||||
{
|
||||
Console.WriteLine("You can manually open the game now");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user