[56] | 1 | /* |
---|
| 2 | * Abuse - dark 2D side-scrolling platform game |
---|
| 3 | * Copyright (c) 1995 Crack dot Com |
---|
[494] | 4 | * Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net> |
---|
[56] | 5 | * |
---|
| 6 | * This software was released into the Public Domain. As with most public |
---|
| 7 | * domain software, no warranty is made or implied by Crack dot Com or |
---|
| 8 | * Jonathan Clark. |
---|
| 9 | */ |
---|
| 10 | |
---|
[2] | 11 | #ifndef __NFSERVER_HPP_ |
---|
| 12 | #define __NFSERVER_HPP_ |
---|
| 13 | |
---|
[481] | 14 | #include "specs.h" |
---|
| 15 | #include "netface.h" |
---|
| 16 | #include "sock.h" |
---|
[2] | 17 | |
---|
| 18 | int net_init(int argc, char **argv); |
---|
| 19 | void net_uninit(); |
---|
| 20 | void service_net_request(); |
---|
| 21 | void wait_min_players(); |
---|
| 22 | void server_check(); |
---|
| 23 | void remove_client(int client_number); |
---|
| 24 | |
---|
| 25 | int net_start(); |
---|
[39] | 26 | bFILE *open_nfs_file(char const *filename, char const *mode); |
---|
[2] | 27 | |
---|
[39] | 28 | int NF_open_file(char const *filename, char const *mode); |
---|
[2] | 29 | long NF_close(int fd); |
---|
| 30 | long NF_read(int fd, void *buf, long size); |
---|
| 31 | long NF_filelength(int fd); |
---|
| 32 | long NF_tell(int fd); |
---|
| 33 | long NF_seek(int fd, long offset); |
---|
| 34 | int NF_set_file_server(net_address *addr); |
---|
| 35 | |
---|
| 36 | int request_server_entry(); |
---|
| 37 | int server_entry_continue(); |
---|
| 38 | void net_reload(); |
---|
| 39 | void read_new_views(); |
---|
[39] | 40 | int set_file_server(char const *name); |
---|
[2] | 41 | int set_file_server(net_address *addr); |
---|
| 42 | |
---|
| 43 | int join_remote_game(char *name); |
---|
| 44 | int become_server(char *name); |
---|
| 45 | int get_remote_lsf(net_address *addr, char *filename); // filename should be 256 bytes |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | void send_local_request(); // sends from *base |
---|
[124] | 49 | int get_inputs_from_server(unsigned char *buf); // return bytes read into buf (will be less than PACKET_MAX_SIZE |
---|
[2] | 50 | |
---|
| 51 | |
---|
| 52 | int client_number(); |
---|
| 53 | extern net_address *net_server; |
---|
| 54 | extern base_memory_struct *base; // points to shm_addr |
---|
| 55 | |
---|
| 56 | #endif |
---|