Package be.demmel.jgws.rmi

Examples of be.demmel.jgws.rmi.LoginServerPlayerData


      // Retrieve the connection with the GameServer
      GameServerPortal gameServerPortal = selectedGameServer.getGameServerPortal();
      // tell the Game Server to accept connections from this client
      try {
        gameServerPortal.acceptPlayerRequest(new LoginServerPlayerData(accountId, characterId, mapId, newKeys1, newKeys2));
      } catch (RemoteException e) {
        LOGGER.error("Failed to register this player with a game server");
        throw new RuntimeException("Failed to register this player with a game server", e);
      }
      // This returned, the Game Server knows about the new client that should connect soon
View Full Code Here


  }
 
  @Override
  public void handlePacket(ChannelHandlerContext ctx, P1280_VerifyClient packet, GameServerSession serverData, List<QueueAction> actions) throws Exception {
    // Try to find accepted player data using the security keys
    LoginServerPlayerData foundPlayerData = GameServer.findPlayerDataBySecurityKeys(packet.getKey1(), packet.getKey2());

    if (foundPlayerData == null) {
      LOGGER.warn("No PlayerData found");
      return;
    }

    LOGGER.info("Searching for map with id: {}", foundPlayerData.getMapId());
    // Retrieve the map that will be loaded
    // TODO: pass instances, don't start using static things everywhere!
    MapData map = GameServer.getMap((int) foundPlayerData.getMapId());

    // Convert the security keys to the right format.... again
    // TODO: decide on 1 format!!
    short[] keys1 = foundPlayerData.getSecurityKey1();
    short[] keys2 = foundPlayerData.getSecurityKey2();

    byte[] newKeys1 = new byte[keys1.length], newKeys2 = new byte[keys2.length];
    for (int i = 0; i < keys1.length; i++) {
      newKeys1[i] = (byte) (keys1[i]);
      newKeys2[i] = (byte) (keys2[i]);
    }

    // Set some data we're probably going to need later on...
    serverData.setAccId((int) foundPlayerData.getAccId());
    // TODO: set the client security keys again later on when needed!
    // serverData.getSecurityKeys()[0] = newKeys1;
    // serverData.getSecurityKeys()[1] = newKeys2;
    serverData.setAccId((int) foundPlayerData.getAccId());

    // Load the character on the map
    // TODO: how do we share maps between teams? We're not going to have all chars on the same map, right??
    CharacterData addedCharacter = loadCharacterById(packet, (int) foundPlayerData.getCharId(), serverData, map);
    serverData.setCurrentCharacter(addedCharacter);

    // add this Player to the map by adding its clientdata!
    //map.addPlayer(clientData); //FIXME: this was commented as the player will be in the general group already and this should be changed to have a group per map/district
View Full Code Here

TOP

Related Classes of be.demmel.jgws.rmi.LoginServerPlayerData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.