/*private static void handleUpdateDimensionMessage(NetIncomingMessage _Im) * { * var message = new UpdateDimensionMessage(_Im); * var timeDelay = (float)(NetTime.Now - _Im.SenderConnection.GetLocalTime(message.MessageTime)); * * if (Configuration.networkManager.client != null) * { * if (true) * { * GameLibrary.Map.Dimension.Dimension var_Dimension = GameLibrary.Map.World.World.world.createDimension(message.DimensionId); * if (var_Dimension != null) * { * if (var_Dimension.IsRequested) * { * var_Dimension.IsRequested = false; * } * } * } * else * { * GameLibrary.Logger.Logger.LogDeb("Dimension sollte hinzugefügt werden, ist allerdings schon vorhanden"); * } * } * }*/ private static void handleUpdateRegionMessage(NetIncomingMessage _Im) { var message = new UpdateRegionMessage(_Im); var timeDelay = (float)(NetTime.Now - _Im.SenderConnection.GetLocalTime(message.MessageTime)); if (Configuration.networkManager.client != null) { if (true) { GameLibrary.Map.Region.Region var_Region = GameLibrary.Map.World.World.world.getDimensionById(message.DimensionId).getRegionAtPosition(message.Position); if (var_Region != null) { if (var_Region.IsRequested) { var_Region.RegionEnum = message.RegionEnum; } var_Region.IsRequested = false; } } else { GameLibrary.Logger.Logger.LogDeb("Region sollte hinzugefügt werden, ist allerdings schon vorhanden -> Benutze UpdateChunkMessage"); } } }
private static void handleRequestRegionMessage(NetIncomingMessage _Im) { var message = new RequestRegionMessage(_Im); var timeDelay = (float)(NetTime.Now - _Im.SenderConnection.GetLocalTime(message.MessageTime)); Client var_Client = Configuration.networkManager.getClient(_Im.SenderEndPoint); GameLibrary.Map.Region.Region var_Region = GameLibrary.Map.World.World.world.getDimensionById(message.DimensionId).getRegionAtPosition(message.Position); if (var_Region != null) { Configuration.networkManager.SendMessageToClient(new UpdateRegionMessage(var_Region), var_Client); } else { GameLibrary.Logger.Logger.LogErr("ServerIGameMessageManager->handleRequestRegionMessage(...): Region an Position X: " + message.Position.X + " Y: " + message.Position.Y + " existiert nicht!"); } }