Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exipe.server.game.player;
- import exipe.server.game.Game;
- import exipe.server.game.PlayerHandler;
- import exipe.server.net.client.Client;
- public final class Player {
- private final Client client;
- private final Game game;
- private final Output out =
- new Output(this);
- private final Updating updating =
- new Updating(this);
- private VisiblePlayers visibles =
- new VisiblePlayers(this);
- private final String username, password;
- private int staffRights, posX, posY, height;
- public Player(Client client, String username, String password, Game game) {
- this.client = client;
- this.username = username;
- this.password = password;
- this.game = game;
- }
- public void login() {
- PlayerHandler ph = game.players();
- if(ph.getByName(username) != null) {
- out.sendLoginResponse(5);
- client.disconnect();
- return;
- }
- game.players().put(client.key(), this);
- out.sendLoginResponse(2);
- out.sendMessage("Welcome to Evito RSPS.");
- int[] interfaces = {2423, 3917, 638, 3213, 1644, 5608, 1151, -1, 5065, 5715, 2449, 4445, 147, -1};
- int counter=0;
- for(int i : interfaces) {
- out.sendSidebarInterface(counter, i);
- counter++;
- }
- out.sendRegion();
- }
- public void process() {
- out.sendUpdating();
- }
- public void moveTo(int x, int y, int height) {
- posX = x;
- posY = y;
- this.height = height;
- }
- public void logout() {
- game.players().remove(client.key());
- visibles.removeSelf();
- }
- public Client client() {
- return client;
- }
- public Output out() {
- return out;
- }
- public Updating updating() {
- return updating;
- }
- public VisiblePlayers visibles() {
- return visibles;
- }
- public String username() {
- return username;
- }
- public String password() {
- return password;
- }
- public int staffRights() { return staffRights; }
- public int x() { return posX; }
- public int y() { return posY; }
- public int height() { return height; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement