Mario Kart 64
Loading...
Searching...
No Matches
networking.h File Reference
#include <libultraship.h>
#include <common_structs.h>
#include <SDL2/SDL_net.h>
Include dependency graph for networking.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Network
 
struct  NetworkClient
 

Macros

#define NETWORK_MAX_PLAYERS   8
 
#define NETWORK_USERNAME_LENGTH   32
 

Enumerations

enum  {
  PACKET_JOIN , PACKET_LEAVE , PACKET_MESSAGE , PACKET_LOADED ,
  PACKET_READY_UP , PACKET_SET_CHARACTER , PACKET_COURSE_VOTE , PACKET_SET_COURSE ,
  PACKET_PLAYER_ASSIGN_SLOTS , PACKET_START_SESSION , PACKET_PLAYER , PACKET_ACTOR ,
  PACKET_OBJECT
}
 

Functions

void ConnectToServer (char *ip, uint16_t port, char *username)
 
void networking_init (char *ip, uint16_t port)
 
void networking_update (void)
 
void networking_ready_up (bool)
 
void networking_cleanup (SDLNet_SocketSet)
 
int networking_loop (void *)
 
void handleReceivedData (const char *, size_t)
 
void set_username (const char *username)
 
void network_character_vote (uint32_t course)
 
void network_cup_vote (uint32_t course)
 
void networking_disconnect (void)
 
void spawn_network_players (f32 *, f32 *, f32)
 
void network_all_players_loaded (void)
 
void set_course (const char *data)
 
void networking_start_session (const char *data)
 
void replicate_player (const char *data)
 
void assign_player_slots (const char *data)
 
void send_int_packet (TCPsocket socket, uint8_t type, uint32_t payload, uint16_t size)
 
void handleJoinPacket (const char *data)
 
void handleLeavePacket (const char *data)
 
void handleMessagePacket (const char *data)
 
void handle_start_game (void)
 
void send_str_packet (TCPsocket, uint8_t, const char *)
 

Variables

Network gNetwork
 
NetworkClient dummyClient
 
NetworkClientlocalClient
 
NetworkClient clients []
 

Macro Definition Documentation

◆ NETWORK_MAX_PLAYERS

#define NETWORK_MAX_PLAYERS   8

◆ NETWORK_USERNAME_LENGTH

#define NETWORK_USERNAME_LENGTH   32

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PACKET_JOIN 
PACKET_LEAVE 
PACKET_MESSAGE 
PACKET_LOADED 
PACKET_READY_UP 
PACKET_SET_CHARACTER 
PACKET_COURSE_VOTE 
PACKET_SET_COURSE 
PACKET_PLAYER_ASSIGN_SLOTS 
PACKET_START_SESSION 
PACKET_PLAYER 
PACKET_ACTOR 
PACKET_OBJECT 

Function Documentation

◆ assign_player_slots()

void assign_player_slots ( const char * data)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConnectToServer()

void ConnectToServer ( char * ip,
uint16_t port,
char * username )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_start_game()

void handle_start_game ( void )
Here is the caller graph for this function:

◆ handleJoinPacket()

void handleJoinPacket ( const char * data)
Here is the caller graph for this function:

◆ handleLeavePacket()

void handleLeavePacket ( const char * data)
Here is the caller graph for this function:

◆ handleMessagePacket()

void handleMessagePacket ( const char * data)
Here is the caller graph for this function:

◆ handleReceivedData()

void handleReceivedData ( const char * buffer,
size_t bufSize )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ network_all_players_loaded()

void network_all_players_loaded ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ network_character_vote()

void network_character_vote ( uint32_t course)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ network_cup_vote()

void network_cup_vote ( uint32_t course)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_cleanup()

void networking_cleanup ( SDLNet_SocketSet socketSet)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_disconnect()

void networking_disconnect ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_init()

void networking_init ( char * ip,
uint16_t port )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_loop()

int networking_loop ( void * data)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_ready_up()

void networking_ready_up ( bool value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_start_session()

void networking_start_session ( const char * data)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ networking_update()

void networking_update ( void )

◆ replicate_player()

void replicate_player ( const char * data)
Here is the caller graph for this function:

◆ send_int_packet()

void send_int_packet ( TCPsocket socket,
uint8_t type,
uint32_t payload,
uint16_t size )
Here is the caller graph for this function:

◆ send_str_packet()

void send_str_packet ( TCPsocket socket,
uint8_t type,
const char * payload )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_course()

void set_course ( const char * data)
Todo
SetCourse();
Here is the caller graph for this function:

◆ set_username()

void set_username ( const char * username)
Here is the caller graph for this function:

◆ spawn_network_players()

void spawn_network_players ( f32 * arg0,
f32 * arg1,
f32 arg2 )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ clients

NetworkClient clients[]
extern

◆ dummyClient

NetworkClient dummyClient
extern

◆ gNetwork

Network gNetwork
extern

◆ localClient

NetworkClient* localClient
extern