FS2_Open
Open source remastering of the Freespace 2 engine
multi_sexp.h File Reference
#include "globalincs/pstypes.h"
#include "ship/ship.h"

Go to the source code of this file.

Functions

void initalise_sexp_packet ()
 
void multi_start_callback ()
 
void multi_end_callback ()
 
void multi_do_callback ()
 
void multi_sexp_flush_packet ()
 
void multi_send_int (int value)
 
void multi_send_ship (ship *shipp)
 
void multi_send_ship (int shipnum)
 
void multi_send_object (object *objp)
 
void multi_send_parse_object (p_object *pobjp)
 
void multi_send_string (char *string)
 
void multi_send_string (const SCP_string &string)
 
void multi_send_bool (bool value)
 
void multi_send_float (float value)
 
void multi_send_short (short value)
 
void multi_send_ushort (ushort value)
 
void sexp_packet_received (ubyte *received_packet, int num_ubytes)
 
int multi_sexp_get_next_operator ()
 
int multi_sexp_get_operator ()
 
void multi_finished_callback ()
 
bool multi_sexp_discard_operator ()
 
void multi_discard_remaining_callback_data ()
 
bool multi_get_int (int &value)
 
bool multi_get_ship (int &value)
 
bool multi_get_ship (ship *&shipp)
 
bool multi_get_object (object *&value)
 
bool multi_get_parse_object (p_object *&pobjp)
 
bool multi_get_string (char *buffer)
 
bool multi_get_string (SCP_string &buffer)
 
bool multi_get_bool (bool &value)
 
bool multi_get_float (float &value)
 
bool multi_get_short (short &value)
 
bool multi_get_ushort (ushort &value)
 

Variables

int Multi_sexp_bytes_left
 

Function Documentation

void initalise_sexp_packet ( )

Set up the SEXP packet every frame when the game starts processing SEXPs.

Definition at line 62 of file multi_sexp.cpp.

void multi_discard_remaining_callback_data ( )

attempts to remove all remaining data for the current operator.

Definition at line 819 of file multi_sexp.cpp.

void multi_do_callback ( )

Convenience function that simply calls the two functions above. Used when the server merely needs to signal the clients that a SEXP has been processed but no additional data needs to be sent.

Definition at line 142 of file multi_sexp.cpp.

void multi_end_callback ( )

Called when a server has written all the data it needs to write for this SEXP.

Definition at line 107 of file multi_sexp.cpp.

void multi_finished_callback ( )

Called when the SEXP code has finished processing the current SEXP.

Definition at line 562 of file multi_sexp.cpp.

bool multi_get_bool ( bool &  value)

Attempts to remove a boolean from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 759 of file multi_sexp.cpp.

bool multi_get_float ( float value)

Attempts to remove a float from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 774 of file multi_sexp.cpp.

bool multi_get_int ( int value)

Attempts to remove an int from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 616 of file multi_sexp.cpp.

bool multi_get_object ( object *&  objp)

Attempts to get an object pointer based on the net sig it removes from the SEXP packet. Returns it as the value parameter. Returns false if unable to do so.

Definition at line 676 of file multi_sexp.cpp.

bool multi_get_parse_object ( p_object *&  pobjp)

Attempts to get a parse objects pointer based on the net sig it removes from the SEXP packet. Returns it as the value parameter. Returns false if unable to do so.

Definition at line 702 of file multi_sexp.cpp.

bool multi_get_ship ( int value)

Attempts to get an index for the Ships array based on the net sig it removes from the SEXP packet. Returns it as the value parameter. Returns false if unable to do so.

Definition at line 632 of file multi_sexp.cpp.

bool multi_get_ship ( ship *&  shipp)

Attempts to get a ship pointer based on the net sig it removes from the SEXP packet. Returns it as the value parameter. Returns false if unable to do so.

Definition at line 660 of file multi_sexp.cpp.

bool multi_get_short ( short &  value)

Attempts to remove a short from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 789 of file multi_sexp.cpp.

bool multi_get_string ( char *  buffer)

Attempts to remove a string from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 726 of file multi_sexp.cpp.

bool multi_get_string ( SCP_string buffer)

Definition at line 740 of file multi_sexp.cpp.

bool multi_get_ushort ( ushort value)

Attempts to remove an unsigned short from the SEXP packet and assign it to the value parameter. Returns false if it is unable to do so.

Definition at line 804 of file multi_sexp.cpp.

void multi_send_bool ( bool  value)

Add a boolean to the SEXP packet.

Definition at line 379 of file multi_sexp.cpp.

void multi_send_float ( float  value)

Add a float to the SEXP packet.

Definition at line 398 of file multi_sexp.cpp.

void multi_send_int ( int  value)

Add an int to the SEXP packet.

Definition at line 257 of file multi_sexp.cpp.

void multi_send_object ( object objp)

Add the net sig of an object to the SEXP packet.

Definition at line 308 of file multi_sexp.cpp.

void multi_send_parse_object ( p_object pobjp)

Add the net sig of a parse object to the SEXP packet.

Definition at line 326 of file multi_sexp.cpp.

void multi_send_ship ( ship shipp)

Adds a ship's net sig to the SEXP packet.

Definition at line 290 of file multi_sexp.cpp.

void multi_send_ship ( int  shipnum)

Adds a ship's net sig to the SEXP packet.

Definition at line 276 of file multi_sexp.cpp.

void multi_send_short ( short  value)

Add a short to the SEXP packet.

Definition at line 417 of file multi_sexp.cpp.

void multi_send_string ( char *  string)

Add a string to the SEXP packet. Should only be used for strings TOKEN_LENGTH in size or smaller.

Definition at line 344 of file multi_sexp.cpp.

void multi_send_string ( const SCP_string string)

Definition at line 360 of file multi_sexp.cpp.

void multi_send_ushort ( ushort  value)

Add an unsigned short to the SEXP packet.

Definition at line 436 of file multi_sexp.cpp.

bool multi_sexp_discard_operator ( )

Used to discard the rest of a callback on the client machine.

Definition at line 583 of file multi_sexp.cpp.

void multi_sexp_flush_packet ( )

Flushes out the SEXP packet and sends any data still in there. Called when the game finishes processing SEXPs.

Definition at line 215 of file multi_sexp.cpp.

int multi_sexp_get_next_operator ( )

Gets the next operator from the SEXP packet. Returns the number of the operator or -1 if there are no more operators because the packet is corrupt.

Definition at line 523 of file multi_sexp.cpp.

int multi_sexp_get_operator ( )

Returns the current operator number but does not touch the SEXP packet.

Definition at line 541 of file multi_sexp.cpp.

void multi_start_callback ( )

Called when a server is currently processing a SEXP that needs to send an update to the clients.

Definition at line 79 of file multi_sexp.cpp.

void sexp_packet_received ( ubyte received_packet,
int  num_ubytes 
)

Called when the client recieves a SEXP packet from the server. Removes the data from the packet that underlying code uses and puts into a new array that will work with the rest of the client-side code.

Definition at line 461 of file multi_sexp.cpp.

Variable Documentation

int Multi_sexp_bytes_left

Definition at line 46 of file multi_sexp.cpp.