20,381
edits
RossyMiles (talk | contribs) No edit summary |
m (+cat) |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Flatline is the most recent proposed multiplayer mod for Oni. This document is a work in progress. | Flatline is the most recent proposed multiplayer mod for Oni. This document is a work in progress. | ||
== Protocol Information == | |||
UDP port 2[[Seven|7777]] and it's surrounding ports are unallocated and are unlikely to be used by any other application. | |||
== Flatline API == | == Flatline API == | ||
| Line 42: | Line 45: | ||
These functions provide a basic, single-threaded, blocking UDP server. | These functions provide a basic, single-threaded, blocking UDP server. | ||
int ''' | int '''NetUDPServer_Listen('''uint16_t '''port''', bool (*'''packet_callback''')'''('''char* '''data''', uint16_t '''datalen''', int '''from))'''<br> | ||
Starts a new UDP server on the specified port which calls '''packet_callback''' when a packet is recieved. Does not return until the server has finished running ('''packet_callback''' returns false). | Starts a new UDP server on the specified port which calls '''packet_callback''' when a packet is recieved. Does not return until the server has finished running ('''packet_callback''' returns false). | ||
bool '''NetUDPServer_Send('''sockaddr* '''address''', const char* '''data''', uint16_t '''datalen)'''<br> | bool '''NetUDPServer_Send('''sockaddr* '''address''', const char* '''data''', uint16_t '''datalen)'''<br> | ||
Sends a packet of data to the specified address using the server running on the current thread. This function should only be called from '''packet_callback''' or functions called by '''packet_callback'''. | Sends a packet of data to the specified address using the server running on the current thread. This function should only be called from '''packet_callback''' or functions called by '''packet_callback'''. | ||
=== FLrServer_* === | |||
These functions control the Flatline server. | |||
[[Category:Modding projects]] | |||