wavelength 1.0.0
Loading...
Searching...
No Matches
netlobby.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "app/msgsink.h"
6#include "game/campaign.h"
8#include "os/string.h"
9
17class NetLobby {
18public:
24 NetLobby() : mSink(nullptr) {
25 }
26
35 virtual ~NetLobby() {
36 }
37
47 virtual void SetSink(MsgSink *pSink) {
48 mSink = pSink;
49 }
50
56 virtual void SetProfile(Campaign *pProfile) = 0;
57
63 virtual void Connect(MsgSink *pSink) = 0;
64
72 virtual void Login(MsgSink *pSink, int nLocation, const char *pszPassword) = 0;
73
79 virtual void Disconnect(MsgSink *pSink) = 0;
80
86 virtual int GetAccountId() = 0;
87
94 virtual void CreateAccount(MsgSink *pSink, const char *pszPassword) = 0;
95
101 virtual void DeleteAccount(MsgSink *pSink) = 0;
102
110 virtual void
111 ChangePassword(MsgSink *pSink, const char *pszOldPassword, const char *pszNewPassword) = 0;
112
118 virtual void RequestLobbyPlayers(MsgSink *pSink) = 0;
119
128 virtual void RequestLaunchpadPlayers(MsgSink *pSink, int nLaunchpad) = 0;
129
136 virtual void AddLadderListener(MsgSink *pSink, int nAccount) = 0;
137
144 virtual void SetMuted(int nAccount, bool bMuted) = 0;
145
158 virtual void RequestLaunchpads(MsgSink *pSink,
159 int nStart,
160 int nMode,
161 const char *pszArena,
162 int nRuleSet,
163 int nSkillLevel) = 0;
164
171 virtual void FindPlayer(MsgSink *pSink, const char *pszName) = 0;
172
178 virtual void RequestChatrooms(MsgSink *pSink) = 0;
179
188 virtual void JoinChatroom(MsgSink *pSink, int nChatroomId) = 0;
189
196 virtual void CreateChatroom(MsgSink *pSink, const String &name) = 0;
197
208 virtual void RequestRanks(MsgSink *pSink, int nCount, int nDirection, int nMode) = 0;
209
216 virtual void UploadRemix(MsgSink *pSink, const char *pszNote) = 0;
217
223 virtual void RequestRemixes(MsgSink *pSink) = 0;
224
231 virtual void DownloadRemix(MsgSink *pSink, const char *pszName) = 0;
232
239 virtual void RequestFiles(MsgSink *pSink, int nRemixes) = 0;
240
247 virtual void UploadDirectory(MsgSink *pSink, std::list<NetRepoRemix> *pRemixes) = 0;
248
255 virtual void DeleteFile(MsgSink *pSink, const char *pszName) = 0;
256
258 MsgSink *GetSink() const {
259 return mSink;
260 }
261
262private:
263 MsgSink *mSink;
264};
265
272extern NetLobby *TheNetLobby;
Saved settings and progress of one player, among them the controller bindings.
Definition campaign.h:20
Receiver of engine messages.
Definition msgsink.h:21
The online lobby service: accounts, chat rooms, launchpads, and the remix repository.
Definition netlobby.h:17
virtual void Login(MsgSink *pSink, int nLocation, const char *pszPassword)=0
Start logging in the local player.
virtual void CreateChatroom(MsgSink *pSink, const String &name)=0
Start creating a chat room and joining it.
MsgSink * GetSink() const
Definition netlobby.h:258
virtual ~NetLobby()
Release the service.
Definition netlobby.h:35
virtual void RequestRemixes(MsgSink *pSink)=0
Start listing the remixes of the repository.
virtual void SetMuted(int nAccount, bool bMuted)=0
Mute or unmute the chat of a player.
virtual void RequestRanks(MsgSink *pSink, int nCount, int nDirection, int nMode)=0
Start listing a page of the ranking.
virtual void ChangePassword(MsgSink *pSink, const char *pszOldPassword, const char *pszNewPassword)=0
Start changing the password of the local player.
virtual void Disconnect(MsgSink *pSink)=0
Start disconnecting from the lobby server.
virtual void JoinChatroom(MsgSink *pSink, int nChatroomId)=0
Join a chat room.
virtual void Connect(MsgSink *pSink)=0
Start connecting to the lobby server.
virtual int GetAccountId()=0
Report the account of the local player.
virtual void DeleteFile(MsgSink *pSink, const char *pszName)=0
Start deleting a file of the repository.
virtual void UploadDirectory(MsgSink *pSink, std::list< NetRepoRemix > *pRemixes)=0
Start uploading the remix directory to the repository, in place of the stored directory.
virtual void DownloadRemix(MsgSink *pSink, const char *pszName)=0
Start downloading a remix from the repository.
virtual void DeleteAccount(MsgSink *pSink)=0
Start deleting the account of the local player.
virtual void RequestChatrooms(MsgSink *pSink)=0
Start listing the chat rooms of the lobby.
NetLobby()
Construct a service with no receiver.
Definition netlobby.h:24
virtual void FindPlayer(MsgSink *pSink, const char *pszName)=0
Start finding a player by name.
virtual void RequestLaunchpads(MsgSink *pSink, int nStart, int nMode, const char *pszArena, int nRuleSet, int nSkillLevel)=0
Start listing the launchpads of the lobby.
virtual void RequestLaunchpadPlayers(MsgSink *pSink, int nLaunchpad)=0
Start listing the players of a launchpad.
virtual void AddLadderListener(MsgSink *pSink, int nAccount)=0
Add a listener the service reports ladder positions to.
virtual void RequestFiles(MsgSink *pSink, int nRemixes)=0
Start listing the files of the repository.
virtual void SetSink(MsgSink *pSink)
Make a sink the receiver of the lobby's result messages.
Definition netlobby.h:47
virtual void RequestLobbyPlayers(MsgSink *pSink)=0
Start listing the players of the current chat room.
virtual void UploadRemix(MsgSink *pSink, const char *pszNote)=0
Start uploading the current remix to the repository.
virtual void SetProfile(Campaign *pProfile)=0
Take the name, the password, and the Freq of the local player.
virtual void CreateAccount(MsgSink *pSink, const char *pszPassword)=0
Start creating an account for the local player.
Growable text buffer that is also a PrnStream.
Definition string.h:19
NetLobby * TheNetLobby
The lobby service.