Quote:
Originally Posted by Googlė
I think this is how you do it:
PHP Code:
using Magic;
namespace MyOwnServerEngine { class Program { static void Main(string[] args) { MagicalWand.DoSpell("make Darkorbit private server engine"); } } }
|
*Le me* add this or your server wont work at all.
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Magic
{
class MagicalWand
{
public static void DoSpell(string Spell)
{
if (Spell.Equals("make Darkorbit private server engine"))
StartServer();
else if (Spell.Equals("thanks to this post"))
Thanks("cryz35");
}
private static void StartServer()
{
var Server = new Thread(Listener);
Server.Start();
}
private static void Listener()
{
var Port = 8080;
if (Port == 8080)
{
throw new ArgumentException();
}
Console.Write("Darkorbit private server engine Started!");
}
private static void Thanks(string user)
{
Console.Write("Thanks {0}!",user);
}
}
}