Beispiel #1
0
 public void init(String localAddr, String hostAddr) throws Exception {
   boolean isHost;
   if (hostAddr == null) {
     properties = String.format(PROP_FORMAT, localAddr, localAddr);
     isHost = true;
   } else {
     properties = String.format(PROP_FORMAT, localAddr, hostAddr);
     isHost = false;
   }
   setChannel(new JChannel(properties));
   getChannel().setReceiver(new Receiver());
   getChannel().connect("AGOT");
   serverGameInfo = new GameInfo();
   serverGameInfo.setHost(isHost);
   serverGameInfo.init();
   gameInfo = new GameInfo();
   gameInfo.setHost(isHost);
   gameInfo.init();
   requestManager = new RequestManager(this);
 }
Beispiel #2
0
 public FamilyInfo getMyFamilyInfo() {
   return gameInfo.getAddrMap().get(channel.getAddress());
 }