package br.odb.multiplayer.model;

import java.util.HashMap;

import javax.servlet.ServletContext;

public class ServerContext {
	public final HashMap<Integer, Game> games = new HashMap<Integer, Game>();
	public final HashMap< String, Game > gameBuilders = new HashMap< String, Game >(); 
	
	public ServerContext() {
	}

	public static ServerContext createOrRetrieve( ServletContext servletContext) {

		ServerContext context = (ServerContext) servletContext
				.getAttribute("games-context");

		if (context == null) {
			reset( servletContext );
		}

		return context;
	}

	public static void reset(ServletContext servletContext) {
		servletContext.setAttribute("games-context", new ServerContext() );
	}
}

@@ -542,16 +542,95 @@
 text );%0A
+%09%09%09%0A%09%09%09context = (ServerContext) servletContext.getAttribute(%22games-context%22);%0A
 %09%09%7D%0A%0A%09%09r

Fix idiotic bug in GetGameId