Beginnings of the netcode

This commit is contained in:
2020-10-28 10:25:11 -04:00
parent 7e361f6758
commit 5559c3b31e
10 changed files with 249 additions and 2 deletions

23
scripts/Game.cs Normal file
View File

@@ -0,0 +1,23 @@
using Godot;
using Network;
public class Game : Node
{
public static Network.Network network;
public override void _Ready()
{
network = new Network.Network(GetTree());
AddChild(network);
if(OS.GetEnvironment("DEDICATED_SERVER") == "true" || OS.GetName() == "Server")
{
GD.Print("Attempting to start server...");
network.StartServer();
}
else
{
GD.Print("Attempting to start client...");
network.StartClient();
}
}
}