You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.3 KiB
45 lines
1.3 KiB
|
7 years ago
|
#pragma once
|
||
|
|
|
||
|
|
#include <queue>
|
||
|
5 years ago
|
#include <string>
|
||
|
7 years ago
|
|
||
|
|
#include "dvlnet/abstract_net.h"
|
||
|
|
|
||
|
5 years ago
|
namespace devilution {
|
||
|
7 years ago
|
namespace net {
|
||
|
|
|
||
|
|
class loopback : public abstract_net {
|
||
|
|
private:
|
||
|
|
std::queue<buffer_t> message_queue;
|
||
|
|
buffer_t message_last;
|
||
|
6 years ago
|
int plr_single;
|
||
|
7 years ago
|
|
||
|
|
public:
|
||
|
6 years ago
|
loopback()
|
||
|
|
{
|
||
|
|
plr_single = 0;
|
||
|
|
};
|
||
|
|
|
||
|
7 years ago
|
virtual int create(std::string addrstr, std::string passwd);
|
||
|
|
virtual int join(std::string addrstr, std::string passwd);
|
||
|
|
virtual bool SNetReceiveMessage(int *sender, char **data, int *size);
|
||
|
|
virtual bool SNetSendMessage(int dest, void *data, unsigned int size);
|
||
|
|
virtual bool SNetReceiveTurns(char **data, unsigned int *size,
|
||
|
5 years ago
|
DWORD *status);
|
||
|
7 years ago
|
virtual bool SNetSendTurn(char *data, unsigned int size);
|
||
|
|
virtual int SNetGetProviderCaps(struct _SNETCAPS *caps);
|
||
|
|
virtual bool SNetRegisterEventHandler(event_type evtype,
|
||
|
5 years ago
|
SEVTHANDLER func);
|
||
|
7 years ago
|
virtual bool SNetUnregisterEventHandler(event_type evtype,
|
||
|
5 years ago
|
SEVTHANDLER func);
|
||
|
7 years ago
|
virtual bool SNetLeaveGame(int type);
|
||
|
|
virtual bool SNetDropPlayer(int playerid, DWORD flags);
|
||
|
|
virtual bool SNetGetOwnerTurnsWaiting(DWORD *turns);
|
||
|
5 years ago
|
virtual bool SNetGetTurnsInTransit(DWORD *turns);
|
||
|
7 years ago
|
virtual void setup_gameinfo(buffer_t info);
|
||
|
5 years ago
|
virtual std::string make_default_gamename();
|
||
|
7 years ago
|
};
|
||
|
|
|
||
|
|
} // namespace net
|
||
|
5 years ago
|
} // namespace devilution
|