Commit 30bd894d authored by 神楽坂玲奈's avatar 神楽坂玲奈

environment variables

parent 2241def4
...@@ -9,7 +9,7 @@ namespace WindBot ...@@ -9,7 +9,7 @@ namespace WindBot
{ {
public class Program public class Program
{ {
public const short ProVersion = 0x1338; public static short ProVersion = Int16.Parse(Environment.GetEnvironmentVariable("YGOPRO_VERSION"));
internal static Random Rand; internal static Random Rand;
...@@ -40,15 +40,11 @@ namespace WindBot ...@@ -40,15 +40,11 @@ namespace WindBot
{ {
Init("cards.cdb"); Init("cards.cdb");
// Start two clients and connect them to the same server. Which deck is gonna win? GameClient client = new GameClient(Environment.GetEnvironmentVariable("YGOPRO_NAME"), Environment.GetEnvironmentVariable("YGOPRO_DECK"), Environment.GetEnvironmentVariable("YGOPRO_HOST"), Int32.Parse(Environment.GetEnvironmentVariable("YGOPRO_PORT")));
GameClient clientA = new GameClient("Wind", "Horus", "127.0.0.1", 7911); client.Start();
GameClient clientB = new GameClient("Fire", "OldSchool", "127.0.0.1", 7911); while (client.Connection.IsConnected)
clientA.Start();
clientB.Start();
while (clientA.Connection.IsConnected || clientB.Connection.IsConnected)
{ {
clientA.Tick(); client.Tick();
clientB.Tick();
Thread.Sleep(1); Thread.Sleep(1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment