public GameClient(Uri ph_uri, Uri mh_uri, Uri ch_uri) { client = this; // Create game simulation. game_sim = new ClientSimulation(); // Create game state. game_state = new ClientState(); // Create rendering instance renderer = new Renderer(320, 240); // Create connection Hubs player_hub_conn = new HubConnectionBuilder().WithUrl(ph_uri).Build(); map_hub_conn = new HubConnectionBuilder().WithUrl(mh_uri).Build(); chat_hub_conn = new HubConnectionBuilder().WithUrl(ch_uri).Build(); player_client = new PlayerClient(player_hub_conn); map_client = new MapClient(map_hub_conn); map_client.loadMapFromServer(); chat_client = new ChatClient(chat_hub_conn); //chat_client.onChatUpdated += refreshMessages; player_hub_conn.SendAsync("registerPlayerConnection", game_state.player); player_hub_conn.SendAsync("getSprites"); player_hub_conn.SendAsync("getTextures"); b_is_running = true; doGameLoop(); }