.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Cyborg Factory > United Bot
United Bot The ultimate beast is being given birth right here! Half-Life 2

Reply
 
Thread Tools
a 'server' class?
Old
  (#1)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,075
Join Date: Nov 2003
Location: Netherlands
Default a 'server' class? - 22-12-2004

i found in the RACC code, some things about a server.

But, i am thinking of NOT including that in my source. I mean, the server side things are mostly interface depended, so that would either mean i end up with lots of functions , but those are empty, or just double-working , because i do:

IF_ServerXXX
runs -> Actual function

which i find pointless

the only thing i can think of is like a round detection. What is handy? I'd like some sort of discussion. How to keep most code 'engine independent', but a tthe same time functional? ???


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
   
Reply With Quote
Re: a 'server' class?
Old
  (#2)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: a 'server' class? - 23-12-2004

Do you really need a class for the server? Couldn't it just be a namespace?


sfx1999.postcount++
   
Reply With Quote
Re: a 'server' class?
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 4643'60N 043'0W 0.187A
Default Re: a 'server' class? - 23-12-2004

What ? In my code anything that is in the server_t structure is completely engine and game independent. This structure deals about the most generic parameters that can be. Here's it's current state:
Code:
// server structure definition
typedef struct server_s
{
   bool is_dedicated; // set to TRUE if the server is a dedicated (standalone) server
   char map_name[32]; // name of the map currently playing on the server
   int max_players; // maximum number of connected client players this server allows at a time
   int max_entities; // maximum number of entities this server supports at a time
   bool is_multiplayer; // set to TRUE if the game going on is multiplayer (generally yes, duh)
   bool is_teamplay; // set to TRUE if the game going on is a team play game
   bool does_footsteps; // set to TRUE if the game rules allow footstep sounds
   char developer_level; // the current internal debug level this server is running on
   bool just_booted; // set to TRUE if this server has just booted on a particular map
   float start_time; // time at which the server started
   float time; // pointer to current time on server
   float previous_time; // past time on server, after the last frame has been rendered
   float frame_time; // last frame time, computed using time and previous_time
   float bot_check_time; // date at which the server will check the bot population
   int bot_count; // number of bots currently present on the server
   bool bot_requested; // set to TRUE if we are requested to slap a bot in
   char server_command[256]; // server command to be issued this frame
   char hud_printbuffer[16384]; // data to be printed to the listen server client's HUD this frame
   char console_printbuffer[16384]; // data to be printed to the server console this frame
   char aiconsole_printbuffer_left[512]; // data to be printed on the left AI console channel
   char aiconsole_printbuffer_center[512]; // data to be printed on the center AI console channel
   char aiconsole_printbuffer_right[512]; // data to be printed on the right AI console channel
   draw_line_t drawlines[256]; // array of beams the server must draw this frame
   int drawline_count; // the number of beams to draw this frame
} server_t;
I really see nothing engine or game specific in it ??



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
   
Reply With Quote
Re: a 'server' class?
Old
  (#4)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,075
Join Date: Nov 2003
Location: Netherlands
Default Re: a 'server' class? - 23-12-2004

i probably misread it then, i was referring to Server() functions..


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
   
Reply With Quote
Re: a 'server' class?
Old
  (#5)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: a 'server' class? - 23-12-2004

maybe you could explain your 'pointless' quote a bit, dunno what you meant with that

Quote:
IF_ServerXXX
runs -> Actual function
this IF doesnt hve anything to do with "if", right ? it's "independant F...".

why not wrap all the functions ? most of them are similar in different engines, like entities. and when you have an additional wrapper class which handles handling your entities it won't be too difficult to write a SearchEntityInSphere function. and using a base class with empty virtual functions, you don't have trouble to call nonimplemented functions, since they simply do nothing and youi don't have to care about NULL function pointers ...



Last edited by @$3.1415rin; 23-12-2004 at 13:20..
   
Reply With Quote
Re: a 'server' class?
Old
  (#6)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 4643'60N 043'0W 0.187A
Default Re: a 'server' class? - 23-12-2004

exactly my point Aspirin. In my code I use my own FindEntityInSphere, FindEntityByClassname, IsNull (FNullEnt equivalent), IndexOfEntity and the likes, etc, etc.

@Stefan: if you're talking about these functions:
Code:
player_t *HLEngine_CreateFakeClient (profile_t *pProfile);
void HLEngine_MoveFakeClient (player_t *pPlayer);
void HLEngine_FakeClientCommand (player_t *pPlayer);
void HLEngine_SendWelcomeMessage (player_t *pPlayer);
unsigned long HLEngine_InputButtonsOf (edict_t *pEntity);
void HLEngine_PrintHUD (void);
void HLEngine_PrintConsole (void);
void HLEngine_PrintGlow (char channel);
void HLEngine_DrawLines (void);
void HLEngine_ExtractFile (char *input_file, char *output_file);
void HLEngine_RACCServerCommandCallback (void);
they're not exported. They're used in the engine interface ONLY. The functions that are exported to the rest of the bot code are these ones:
Code:
// interface.cpp functions prototypes (these functions are exported)
test_result_t PlayerTestLine (player_t *pPlayer, vec v_start, vec v_end);
test_result_t PlayerTestHull (player_t *pPlayer, vec v_start, vec v_end, bool crouching_player);
test_result_t TestVisibility (vec v_start, vec v_end, entity_t *pIgnoredEntity);
vec GetBonePosition (entity_t *pEntity, int bone_number);
char FindMaterialType (entity_t *pEntityTextureIsOn, vec v_start, vec v_end);
bool PointBelongsToWorld (vec v_location);
bool IsLiquid (vec v_location);
bool IsThinAir (vec v_location);
float IlluminationOf (entity_t *pEntity);
void PlayerStartTalking (player_t *pPlayer);
void PlayerStopTalking (player_t *pPlayer);
I bet you understand things better now



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
   
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com