// failcheck
if (mapEntity == null) { return null; }
// try create the game app (with mapid parameter)
GameAppManager manager = context.get().getManager();
// failcheck
if (manager == null || !manager.canCreateGameApp("MapShard")) { return null; }
// create the gameapp
HashMap<String,String> params = new HashMap<>();
params.put("MapId", String.valueOf(mapEntity.getId()));
params.put("IsPvP", String.valueOf(false));
params.put("IsOutpost", String.valueOf(isOutpost));
params.put("InstanceNumber", String.valueOf(instanceNumber));
params.put("DistrictRegion", region.toString());
params.put("DistrictLanguage", language.toString());
Handle<GameAppContext> mapShardContext = manager.createGameApp("MapShard", context, params);
// failcheck
if (mapShardContext == null) { return null; }
// create the bean