public HeartBeatServer(IPEndPoint endpoint, GameServerStorage storage) { this.endpoint = endpoint; this.storage = storage; socket = new UdpClient(endpoint); Clock = new Timer(_ => Tick(), null, BasicInterval, BasicInterval); }
public HeartBeatAgent(IPEndPoint remote, HeartBeatServer server, GameServerStorage storage, Action disposeServer) { this.remote = remote; this.server = server; this.storage = storage; this.disposeServer = disposeServer; AddedAt = DateTime.UtcNow; Console.WriteLine("Created HeartBeatAgent for {0}", remote); }
static async Task <GameServerStorage> ReadGameServerStorage(FileInfo storageFile, CancellationToken ct) { try { Console.WriteLine("Reading {0}", storageFile.FullName); return(await GameServerStorage.Deserialize(storageFile)); } catch (FileNotFoundException) { Console.WriteLine("{0} not found", storageFile.FullName); } catch (Exception ex) { Console.Error.WriteLine("Could not deserialize {0} because", storageFile.FullName); Console.Error.WriteLine(ex); } return(new GameServerStorage(ct, storageFile)); }
public MasterServer(GameServerStorage gameServerStorage) { this.gameServerStorage = gameServerStorage; }