<commit_before>package org.menacheri;

import java.util.concurrent.TimeUnit;

import org.apache.log4j.PropertyConfigurator;
import org.menacheri.app.IGameRoom;
import org.menacheri.app.ITask;
import org.menacheri.context.AppContext;
import org.menacheri.server.IServerManager;
import org.menacheri.service.ITaskManagerService;
import org.menacheri.zombie.domain.World;
import org.menacheri.zombie.domain.WorldMonitor;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class GameServer
{
	
	public static void main(String[] args)
	{
		PropertyConfigurator.configure(System
				.getProperty("log4j.configuration"));
		AbstractApplicationContext context = new ClassPathXmlApplicationContext(
		"/beans/beans.xml");
		
		// For the destroy method to work.
		context.registerShutdownHook();
		
		// Start the main game server
		IServerManager serverManager = (IServerManager)AppContext.getBean(AppContext.SERVER_MANAGER);
		//serverManager.startServers(8090,843,8081);
		serverManager.startServers();
		System.out.println("Started servers");
		startGames();
	}
	
	public static void startGames()
	{
		World world = (World) AppContext.getBean("world");
		world.setAlive(2000000000);
		IGameRoom room = (IGameRoom)AppContext.getBean("Zombie_ROOM_1");
		ITask monitor = new WorldMonitor(world,room);
		ITaskManagerService taskManager = (ITaskManagerService)AppContext.getBean(AppContext.TASK_MANAGER_SERVICE);
		taskManager.scheduleWithFixedDelay(monitor, 500, 5000, TimeUnit.MILLISECONDS);
	}
	
}
<commit_msg>Added logging and exception handling.<commit_after>package org.menacheri;

import java.util.concurrent.TimeUnit;

import org.apache.log4j.PropertyConfigurator;
import org.menacheri.app.IGameRoom;
import org.menacheri.app.ITask;
import org.menacheri.context.AppContext;
import org.menacheri.server.IServerManager;
import org.menacheri.service.ITaskManagerService;
import org.menacheri.zombie.domain.World;
import org.menacheri.zombie.domain.WorldMonitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class GameServer
{
	private static final Logger LOG = LoggerFactory.getLogger(GameServer.class);
	
	public static void main(String[] args)
	{
		PropertyConfigurator.configure(System
				.getProperty("log4j.configuration"));
		AbstractApplicationContext context = new ClassPathXmlApplicationContext(
		"/beans/beans.xml");
		
		// For the destroy method to work.
		context.registerShutdownHook();
		
		// Start the main game server
		IServerManager serverManager = (IServerManager)AppContext.getBean(AppContext.SERVER_MANAGER);
		//serverManager.startServers(18090,843,8081);
		try
		{
			serverManager.startServers();
		}
		catch (Exception e)
		{
			LOG.error("Unable to start servers cleanly: {}",e);
		}
		System.out.println("Started servers");
		startGames();
	}
	
	public static void startGames()
	{
		World world = (World) AppContext.getBean("world");
		world.setAlive(2000000000);
		IGameRoom room = (IGameRoom)AppContext.getBean("Zombie_ROOM_1");
		ITask monitor = new WorldMonitor(world,room);
		ITaskManagerService taskManager = (ITaskManagerService)AppContext.getBean(AppContext.TASK_MANAGER_SERVICE);
		taskManager.scheduleWithFixedDelay(monitor, 500, 5000, TimeUnit.MILLISECONDS);
	}
	
}

{'fraction_non_alphanumeric': 0.10083798882681565, 'fraction_numerical': 0.018156424581005588, 'mean_word_length': 4.938640132669984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1084396', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1104, 'n_words': 188}