Files
pvvmud/common/include/msgsrvcli.H
2025-03-05 08:37:43 +01:00

180 lines
5.6 KiB
C++

/*
* PVVMUD a 3D MUD
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
*
* This program 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
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _MSGSRVCLI_H
#define _MSGSRVCLI_H
#include "message.H"
#include "viewpoint.H"
#include "inetaddress.H"
class CMsgHello : public CMessage {
public:
CMsgHello();
CMsgHello(WORD version);
WORD getVersion();
};
#define LOGINNAMELENGTH 32
#define LOGINPASSWDLENGTH 32
class CMsgLogin : public CMessage {
public:
CMsgLogin();
CMsgLogin(char * name, char * passwd, BOOL newUser = FALSE);
char * getUserName();
char * getPasswd();
BOOL getNewUser();
};
class CMsgServerInfo : public CMessage {
public:
CMsgServerInfo();
CMsgServerInfo(CInetAddress & worldSrvAddress, CInetAddress & gosAddress);
CInetAddress * getWorldSrvAddress();
CInetAddress * getGOSAddress();
};
class CMsgGOSInfo : public CMessage {
public:
CMsgGOSInfo();
CMsgGOSInfo(CInetAddress & gosAddress);
CInetAddress * getGOSAddress();
};
#define MSGBYE_QUIT 1
#define MSGBYE_UNKNOWN 2
#define MSGBYE_BADPROTOCOL 3
class CMsgBye : public CMessage {
public:
CMsgBye();
CMsgBye(WORD reason);
WORD getReason();
char * getReasonString(WORD reason);
};
class CMsgGetWorld : public CMessage {
public:
CMsgGetWorld();
};
#define MSGCOMMAND_CLIENTCLEARWORLD 1
#define MSGCOMMAND_ONLINE 2
// World commands
#define MSGCOMMAND_ADDWORLD 100
#define MSGCOMMAND_REMOVEWORLD 101
#define MSGCOMMAND_PLAYERLOOK 1000
#define PLAYERLOOK_DEFAULT (MSGCOMMAND_PLAYERLOOK + 0)
#define PLAYERLOOK_UP (MSGCOMMAND_PLAYERLOOK + 1)
#define PLAYERLOOK_DOWN (MSGCOMMAND_PLAYERLOOK + 2)
#define PLAYERLOOK_RIGHT (MSGCOMMAND_PLAYERLOOK + 3)
#define PLAYERLOOK_LEFT (MSGCOMMAND_PLAYERLOOK + 4)
#define PLAYERLOOK_FORWARD (MSGCOMMAND_PLAYERLOOK + 5)
#define PLAYERLOOK_BACKWARD (MSGCOMMAND_PLAYERLOOK + 7)
#define MSGCOMMAND_PLAYERMOVE 2000
#define PLAYERMOVE_STEPFORWARD (MSGCOMMAND_PLAYERMOVE + 1)
#define PLAYERMOVE_STEPBACKWARD (MSGCOMMAND_PLAYERMOVE + 2)
#define PLAYERMOVE_STEPLEFT (MSGCOMMAND_PLAYERMOVE + 3)
#define PLAYERMOVE_STEPRIGHT (MSGCOMMAND_PLAYERMOVE + 4)
#define PLAYERMOVE_MOVEFORWARD (MSGCOMMAND_PLAYERMOVE + 5)
#define PLAYERMOVE_MOVEBACKWARD (MSGCOMMAND_PLAYERMOVE + 6)
#define PLAYERMOVE_MOVELEFT (MSGCOMMAND_PLAYERMOVE + 7)
#define PLAYERMOVE_MOVERIGHT (MSGCOMMAND_PLAYERMOVE + 8)
#define PLAYERMOVE_RUNFORWARD (MSGCOMMAND_PLAYERMOVE + 9)
#define PLAYERMOVE_RUNBACKWARD (MSGCOMMAND_PLAYERMOVE + 10)
#define PLAYERMOVE_RUNLEFT (MSGCOMMAND_PLAYERMOVE + 11)
#define PLAYERMOVE_RUNRIGHT (MSGCOMMAND_PLAYERMOVE + 12)
#define MSGCOMMAND_USERCOMMAND 3000
#define USERCOMMAND_0 (MSGCOMMAND_USERCOMMAND + 0)
#define USERCOMMAND_1 (MSGCOMMAND_USERCOMMAND + 1)
#define USERCOMMAND_2 (MSGCOMMAND_USERCOMMAND + 2)
#define USERCOMMAND_3 (MSGCOMMAND_USERCOMMAND + 3)
#define USERCOMMAND_4 (MSGCOMMAND_USERCOMMAND + 4)
#define USERCOMMAND_5 (MSGCOMMAND_USERCOMMAND + 5)
#define USERCOMMAND_6 (MSGCOMMAND_USERCOMMAND + 6)
#define USERCOMMAND_7 (MSGCOMMAND_USERCOMMAND + 7)
#define USERCOMMAND_8 (MSGCOMMAND_USERCOMMAND + 8)
#define USERCOMMAND_9 (MSGCOMMAND_USERCOMMAND + 9)
class CMsgCommand : public CMessage {
public:
CMsgCommand();
CMsgCommand(WORD command);
WORD getCommand();
};
class CMsgViewpoint : public CMessage {
public:
CMsgViewpoint();
CMsgViewpoint(CViewpoint & viewpoint);
void getPosition(CPosition & position);
void getDirection(CDirection & direction );
DWORD getTargetId();
};
class CMsgSelection : public CMessage {
public:
CMsgSelection();
CMsgSelection(WORD objectId);
WORD getObjectId();
};
class CMsgAction : public CMessage {
public:
CMsgAction();
CMsgAction(WORD objectId,WORD actionId);
WORD getObjectId();
WORD getActionId();
};
class CMsgPlayerInfo : public CMessage {
public:
CMsgPlayerInfo();
CMsgPlayerInfo( DWORD masterCellId );
DWORD getMasterCellId();
};
class CMsgPing : public CMessage {
public:
CMsgPing();
CMsgPing( BYTE sequenceNumber );
BYTE getSequenceNumber();
};
class CMsgPong : public CMessage {
public:
CMsgPong();
CMsgPong( BYTE sequenceNumber, DWORD serverTime );
BYTE getSequenceNumber();
DWORD getServerTime();
};
#endif // _MESSAGE_H