Phasor  01.00.10.059
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Classes | Functions | Variables
halo::server Namespace Reference

Namespaces

namespace  chat
 
namespace  gametypes
 
namespace  maploader
 
namespace  mapvote
 
namespace  misc
 
namespace  scriptloader
 

Classes

struct  s_hash_data
 
struct  s_hash_list
 
struct  s_command_cache
 
struct  s_connection_info
 Represents Halo's connection information structure (ip, port, keys etc) More...
 
struct  s_machine_info
 Represents an entry in Halo's machine table. More...
 
struct  s_presence_item
 Represents an entry in Halo's connection player table. More...
 
struct  s_server_info
 Server related items (name, gametype, players, machines) More...
 
struct  s_command_input
 
struct  s_hash_validation
 
struct  s_machinfo_info_partial_packet
 
struct  PhasorMachine
 
class  SayStreamRaw
 
class  SayStream
 

Functions

DWORD BuildPacket (LPBYTE output, DWORD arg1, DWORD packettype, DWORD arg3, LPBYTE dataPtr, DWORD arg4, DWORD arg5, DWORD arg6)
 
void AddPacketToGlobalQueue (LPBYTE packet, DWORD packetCode, DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5)
 
void AddPacketToPlayerQueue (DWORD player, LPBYTE packet, DWORD packetCode, DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5)
 
s_server_infoGetServerStruct ()
 Get the server struct.
 
PhasorMachineFindMachineById (DWORD machineNum)
 
PhasorMachineFindMachineByIndex (DWORD index)
 
PhasorMachineFindMachine (const s_player &player)
 
void __stdcall OnMachineConnect (DWORD machineIndex)
 
void __stdcall OnMachineDisconnect (DWORD machineIndex)
 
void __stdcall OnMachineInfoFix (s_machinfo_info_partial_packet *data)
 
void __stdcall ConsoleHandler (DWORD fdwCtrlType)
 Called for Windows related console events (ie closing the server)
 
void __stdcall OnConsoleProcessing ()
 Called every cycle to read input from the user. I use it for timers.
 
void __stdcall OnClientUpdate (s_player_structure *m_player)
 Called when a client sends its update packet (new pos, fire etc)
 
bool __stdcall OnMapLoad (maploader::s_mapcycle_entry *loading_map)
 Called when a map is being loaded.
 
void __stdcall OnNewGame (const char *map)
 Called when a new game starts.
 
void __stdcall OnGameEnd (DWORD mode)
 Called when a game stage ends.
 
void __stdcall OnHaloPrint (char *msg)
 Called when halo wants to print a message to the console.
 
bool __stdcall OnHaloBanCheck (char *hash, s_machine_info *machine)
 Called when halo checks if the specified hash is banned.
 
void acceptInvalidHashes (bool state)
 
bool getInvalidHashState ()
 
void __stdcall OnHashValidation (s_hash_validation *info, const char *status)
 
void __stdcall ProcessCommandAttempt (s_command_input *input, int playerNum)
 
e_command_result __stdcall ProcessCommand (char *command)
 Called to process a server command, after the password has been validated.
 
void MessagePlayer (const s_player &player, const std::wstring &str)
 Send a chat message to the player.
 
bool ConsoleMessagePlayer (const s_player &player, const std::wstring &str)
 Send a console message to the player.
 
void NotifyServerOfTeamChange (const halo::s_player &player)
 Notifies the server that a player has changed team (syncs it)
 
void ExecuteServerCommand (const std::string &command, s_player *execute_as)
 
void SetExecutingPlayer (halo::s_player *player)
 
halo::s_playerGetPlayerExecutingCommand ()
 Get the player executing the current command.
 
bool GetPlayerHash (const s_player &player, std::string &hash)
 
bool GetMachineHash (const s_machine_info &machine, std::string &hash)
 
bool GetPlayerIP (const s_player &player, std::string *ip, WORD *port)
 
bool GetMachineIP (s_machine_info &machine, std::string *ip, WORD *port)
 
DWORD GetRespawnTicks ()
 
DWORD GetServerTicks ()
 
e_command_result sv_quit (void *, commands::CArgParser &, COutStream &)
 

Variables

SayStream say_stream
 Stream used for server messages.
 
SayStreamRaw say_stream_raw
 
std::unique_ptr< PhasorMachinemachine_list [16]
 
std::string current_map
 
bool allow_invalid_hash = false
 

Function Documentation

void halo::server::acceptInvalidHashes ( bool  state)
void halo::server::AddPacketToGlobalQueue ( LPBYTE  packet,
DWORD  packetCode,
DWORD  arg1,
DWORD  arg2,
DWORD  arg3,
DWORD  arg4,
DWORD  arg5 
)
void halo::server::AddPacketToPlayerQueue ( DWORD  player,
LPBYTE  packet,
DWORD  packetCode,
DWORD  arg1,
DWORD  arg2,
DWORD  arg3,
DWORD  arg4,
DWORD  arg5 
)
DWORD halo::server::BuildPacket ( LPBYTE  output,
DWORD  arg1,
DWORD  packettype,
DWORD  arg3,
LPBYTE  dataPtr,
DWORD  arg4,
DWORD  arg5,
DWORD  arg6 
)
void __stdcall halo::server::ConsoleHandler ( DWORD  fdwCtrlType)

Called for Windows related console events (ie closing the server)

Parameters
fdwCtrlTypeThe type of event.
bool halo::server::ConsoleMessagePlayer ( const s_player &  player,
const std::wstring &  str 
)

Send a console message to the player.

Parameters
playerThe player to send the message to
strThe message to send.
void halo::server::ExecuteServerCommand ( const std::string &  command,
s_player *  execute_as 
)
PhasorMachine * halo::server::FindMachine ( const s_player &  player)
PhasorMachine * halo::server::FindMachineById ( DWORD  machineNum)
PhasorMachine * halo::server::FindMachineByIndex ( DWORD  index)
bool halo::server::getInvalidHashState ( )
bool halo::server::GetMachineHash ( const s_machine_info &  machine,
std::string &  hash 
)
bool halo::server::GetMachineIP ( s_machine_info &  machine,
std::string *  ip,
WORD *  port 
)
halo::s_player * halo::server::GetPlayerExecutingCommand ( )

Get the player executing the current command.

Returns
The player executing the command, or NULL if no player.
bool halo::server::GetPlayerHash ( const s_player &  player,
std::string &  hash 
)
bool halo::server::GetPlayerIP ( const s_player &  player,
std::string *  ip,
WORD *  port 
)
DWORD halo::server::GetRespawnTicks ( )
Todo:
parse these structures
s_server_info * halo::server::GetServerStruct ( )

Get the server struct.

Returns
The server struct.
DWORD halo::server::GetServerTicks ( )
void halo::server::MessagePlayer ( const s_player &  player,
const std::wstring &  str 
)

Send a chat message to the player.

Parameters
playerThe player to send the message to
strThe message to send.
void halo::server::NotifyServerOfTeamChange ( const halo::s_player player)

Notifies the server that a player has changed team (syncs it)

Parameters
playerThe player who changed team.
void __stdcall halo::server::OnClientUpdate ( s_player_structure *  m_player)

Called when a client sends its update packet (new pos, fire etc)

Todo:
make this more efficient.. shouldn't need to GetPlayerFromAddress
Parameters
m_playerThe memory address of the player who is updating.
void __stdcall halo::server::OnConsoleProcessing ( )

Called every cycle to read input from the user. I use it for timers.

void __stdcall halo::server::OnGameEnd ( DWORD  mode)

Called when a game stage ends.

Parameters
modeSpecifies which stage is ending (game, post-game, scorecard)
bool __stdcall halo::server::OnHaloBanCheck ( char *  hash,
s_machine_info *  machine 
)

Called when halo checks if the specified hash is banned.

Parameters
hashThe hash being checked.
Returns
Boolean indicating whether or not the player is allowed to join.
void __stdcall halo::server::OnHaloPrint ( char *  msg)

Called when halo wants to print a message to the console.

void __stdcall halo::server::OnHashValidation ( s_hash_validation *  info,
const char *  status 
)
void __stdcall halo::server::OnMachineConnect ( DWORD  machineIndex)
void __stdcall halo::server::OnMachineDisconnect ( DWORD  machineIndex)
void __stdcall halo::server::OnMachineInfoFix ( s_machinfo_info_partial_packet *  data)
bool __stdcall halo::server::OnMapLoad ( maploader::s_mapcycle_entry *  loading_map)

Called when a map is being loaded.

Parameters
loading_mapThe map being loaded, which can be changed.
Returns
Boolean indicating whether or not the map was changed.
void __stdcall halo::server::OnNewGame ( const char *  map)

Called when a new game starts.

Parameters
mapThe map the game is running.
e_command_result __stdcall halo::server::ProcessCommand ( char *  command)

Called to process a server command, after the password has been validated.

Parameters
commandThe command being executed.
Returns
Value indicating whether or not Halo should process the event.
void __stdcall halo::server::ProcessCommandAttempt ( s_command_input *  input,
int  playerNum 
)
void halo::server::SetExecutingPlayer ( halo::s_player player)
e_command_result halo::server::sv_quit ( void *  ,
commands::CArgParser ,
COutStream  
)

Variable Documentation

bool halo::server::allow_invalid_hash = false
std::string halo::server::current_map
std::unique_ptr<PhasorMachine> halo::server::machine_list[16]
SayStream halo::server::say_stream

Stream used for server messages.

SayStreamRaw halo::server::say_stream_raw