_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

online_service.h
Go to the documentation of this file.
1 #ifndef __ONLINE_SERVICE_H__
2 #define __ONLINE_SERVICE_H__
3 
4 #include <string>
5 
6 #include "network/netsockets.h"
7 
8 class OnlineContext {
9 public:
10  virtual ~OnlineContext() { };
11 
12  // called in the sdl event loop
13  virtual bool handleUDP(const unsigned char *buffer, int len, CHost host) = 0;
14 
15  // called in the sdl event loop
16  virtual void doOneStep() = 0;
17 
18  // called when joining a network game
19  virtual void joinGame(std::string hostPlayerName, std::string pw) = 0;
20 
21  // called when leaving a network game
22  virtual void leaveGame() = 0;
23 
24  // called when advertised game is starting (just reports the game as in-progress)
25  virtual void startAdvertising(bool isStarted = false) = 0;
26 
27  // called when advertised game is left by the server
28  virtual void stopAdvertising() = 0;
29 
30  // called when network game ends
31  virtual void reportGameResult() = 0;
32 };
33 
35 
36 extern void OnlineServiceCclRegister();
37 
38 #endif
OnlineContext::joinGame
virtual void joinGame(std::string hostPlayerName, std::string pw)=0
OnlineContext::doOneStep
virtual void doOneStep()=0
OnlineContext::startAdvertising
virtual void startAdvertising(bool isStarted=false)=0
OnlineContext::reportGameResult
virtual void reportGameResult()=0
OnlineServiceCclRegister
void OnlineServiceCclRegister()
Definition: online_service.cpp:2395
OnlineContext::stopAdvertising
virtual void stopAdvertising()=0
OnlineContext::~OnlineContext
virtual ~OnlineContext()
Definition: online_service.h:10
OnlineContext::leaveGame
virtual void leaveGame()=0
OnlineContext
Definition: online_service.h:8
OnlineContextHandler
OnlineContext * OnlineContextHandler
Definition: online_service.cpp:2189
OnlineContext::handleUDP
virtual bool handleUDP(const unsigned char *buffer, int len, CHost host)=0
netsockets.h
CHost
Definition: netsockets.h:36
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.