Odamex
Setting the Standard in Multiplayer Doom
common/d_netinf.h
Go to the documentation of this file.
00001 // Emacs style mode select   -*- C++ -*- 
00002 //-----------------------------------------------------------------------------
00003 //
00004 // $Id: d_netinf.h 1788 2010-08-24 04:42:57Z russellrice $
00005 //
00006 // Copyright (C) 1998-2006 by Randy Heit (ZDoom).
00007 // Copyright (C) 2006-2010 by The Odamex Team.
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // DESCRIPTION:
00020 //      Multiplayer properties (?)
00021 //
00022 //-----------------------------------------------------------------------------
00023 
00024 
00025 #ifndef __D_NETINFO_H__
00026 #define __D_NETINFO_H__
00027 
00028 #include "c_cvars.h"
00029 
00030 #define MAXPLAYERNAME   15
00031 
00032 enum gender_t
00033 {
00034         GENDER_MALE,
00035         GENDER_FEMALE,
00036         GENDER_NEUTER,
00037         
00038         NUMGENDER
00039 };
00040 
00041 // [Toke - Teams]
00042 // denis - for both teamplay and ctfmode
00043 enum team_t
00044 {
00045         TEAM_BLUE,
00046         TEAM_RED,
00047         
00048         NUMTEAMS,
00049         
00050         TEAM_NONE
00051 };
00052 
00053 struct userinfo_s
00054 {
00055         char                    netname[MAXPLAYERNAME+1];
00056         team_t                  team; // [Toke - Teams] 
00057         fixed_t                 aimdist;
00058         int                             color;
00059         unsigned int    skin;
00060         gender_t                gender;
00061 
00062         userinfo_s() : team(TEAM_NONE), aimdist(0), color(0), skin(0), gender(GENDER_MALE) { *netname = 0; }
00063 };
00064 typedef userinfo_s userinfo_t;
00065 
00066 FArchive &operator<< (FArchive &arc, userinfo_t &info);
00067 FArchive &operator>> (FArchive &arc, userinfo_t &info);
00068 
00069 void D_SetupUserInfo (void);
00070 
00071 void D_UserInfoChanged (cvar_t *info);
00072 
00073 void D_SendServerInfoChange (const cvar_t *cvar, const char *value);
00074 void D_DoServerInfoChange (byte **stream);
00075 
00076 void D_WriteUserInfoStrings (int player, byte **stream, bool compact=false);
00077 void D_ReadUserInfoStrings (int player, byte **stream, bool update);
00078 
00079 #endif //__D_NETINFO_H__
00080 
00081 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends