I'm trying to make a multiplayer game with Unity3D and a .Net console application as a server.
Now I've made a mainGame class which inherits the ServerTime class which should also be initialised upon the creation of the maingame class (hence it is in the constructor of maingame)
The problem though is, that it throws a Stack overflow on the constructor of ServerTime.
public class Program
{
public static void Main()
{
new mainGame("JustAName");
}
public class mainGame
{
public ServerTime serverTime = null;
public mainGame(string a_Roomnme)
{
serverTime = new ServerTime(null);
}
}
public class ServerTime : mainGame
{
public ServerTime(string roomName): base(roomName)
{
//Do something
}
}
}
As it is just simply passing the string to ServerTime I don't see where it could lead to such an exception.
Thank you in advance