This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-crawler-demo/scripts/Game.cs

23 lines
553 B
C#

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();
}
}
}