public void SendWorldPacket(GatewayConnection connection, byte[] data)
{
WorldGatewayConnection worldServer;
if (!WorldGatewayServer.ClientConnectionMap.TryGetValue(connection, out worldServer))
{
if (WorldGatewayServer.Connections.Count == 0)
throw new Exception("We have client connections, but no world servers");
worldServer = WorldGatewayServer.Connections.Cast<WorldGatewayConnection>().FirstOrDefault();
if (worldServer == null)
throw new Exception("Can't find suitable world server for client");
WorldGatewayServer.ClientConnectionMap[connection] = worldServer;
}
worldServer.Send(data);
}