home
// tworze obiekt do komunikacji z serwerem
GlobalObjects.gI().setGameNetworkLogic( new GameNetworkLogic() );
GameNetworkLogic gnl = GlobalObjects.gI().getGameNetworkLogic();
// lacze sie z serwerem
gnl.doConnect( Config.gI().get("server_host"), Integer.parseInt( Config.gI().get("server_port") ) );
gnl.start();
gnl.registerLogic( GlobalObjects.gI().getGameLogic() );
// loguje sie do serwera
gnl.doLogin( Config.gI().get("email"), Config.gI().get("password") );
// pobieram liste pokojow
ArrayList<RoomInfo> gri = (ArrayList<RoomInfo>)gnl.getGamesList();
for( RoomInfo ri : gri ){
System.out.println( "RoomInfo: " + ri.getName() );
}
// wchodze do gry
if( gnl.doJoinGame( "game0" ) == false ){
System.out.println( "chujnia" );
System.exit( 1 );
}
// usuwam wszystkie obiekty u siebie
GlobalObjects.gI().getWorld().delAllObjects();
// wysylam pakiet o update wszystkich obiektów( tak naprawde all wszystkiego przyjdzie )
gnl.doUpdateAllGameObjects();