summaryrefslogtreecommitdiffstats
path: root/doc/ccapi/html/structcc__context__d.html
diff options
context:
space:
mode:
authorJustin Anderson <jander@mit.edu>2007-09-25 21:34:10 +0000
committerJustin Anderson <jander@mit.edu>2007-09-25 21:34:10 +0000
commit403149c8eee2e85c168c365528d9a6443a237fba (patch)
treeeb0b7d9f1175b799245a3b09e04c6359d771a773 /doc/ccapi/html/structcc__context__d.html
parent0c9671a9f8dc5d0efb2638952089fb2b6b78838a (diff)
Update ccapi tests to work at new location in krb5 tree. Also, test for platform when compiling so that KfM and KfW can use this
ticket: 5459 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19979 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'doc/ccapi/html/structcc__context__d.html')
0 files changed, 0 insertions, 0 deletions
d='n113' href='#n113'>113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
/*
 *  The Mana Server
 *  Copyright (C) 2004-2010  The Mana World Development Team
 *
 *  This file is part of The Mana Server.
 *
 *  The Mana Server is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  The Mana Server is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with The Mana Server.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef SERVER_GAMEHANDLER_H
#define SERVER_GAMEHANDLER_H

#include "game-server/character.h"
#include "net/connectionhandler.h"
#include "net/netcomputer.h"
#include "utils/tokencollector.h"

enum
{
    CLIENT_LOGIN = 0,
    CLIENT_CONNECTED,
    CLIENT_CHANGE_SERVER,
    CLIENT_QUEUED
};

struct GameClient: NetComputer
{
    GameClient(ENetPeer *peer)
      : NetComputer(peer), character(NULL), status(CLIENT_LOGIN) {}
    Character *character;
    int status;
};

/**
 * Manages connections to game client.
 */
class GameHandler: public ConnectionHandler
{
    public:
        GameHandler();

        /**
         * Starts the handler
         */
        bool startListen(enet_uint16 port);

        /**
         * Sends message to the given character.
         */
        void sendTo(Character *, MessageOut &msg);

        /**
         * Kills connection with given character.
         */
        void kill(Character *);

        /**
         * Prepares a server change for given character.
         */
        void prepareServerChange(Character *);

        /**
         * Completes a server change for given character ID.
         */
        void completeServerChange(int id, const std::string &token,
                                  const std::string &address, int port);

        /**
         * Updates the party id of the character
         */
        void updateCharacter(int charid, int partyid);

        /**
         * Registers a character that should soon be claimed by a client.
         * @param token token used by the client when connecting.
         */
        void addPendingCharacter(const std::string &token, Character *);

        /**
         * Combines a client with its character.
         * (Needed for TokenCollector)
         */
        void tokenMatched(GameClient *computer, Character *character);