| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #ifndef MULTI_SERVER_H |
| 20 | |
| 21 | #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/ |
| 22 | #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/ |
| 23 | #include "game2dll.h"cxx . . $ `<file>/lib/game2dll.h`/ |
| 24 | // #include "gametrack.h" |
| 25 | |
| 26 | extern int Join_response_stringscxx . . $ Join_response_strings.[]; |
| 27 | |
| 28 | // extern d3_net_game_data D3_tracker_info; |
| 29 | |
| 30 | #define MAX_CHANGED_OBJECTScxx . . $ `Descent3/multi_server.h:30:9`! 700 |
| 31 | |
| 32 | extern int Changed_animcxx . . $ Changed_anim.[MAX_CHANGED_OBJECTScxx . . $ `Descent3/multi_server.h:30:9`!][MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 33 | extern uint16_tcxx . . $ uint16_t# Num_changed_animcxx . . $ Num_changed_anim.[MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 34 | |
| 35 | extern int Changed_wb_animcxx . . $ Changed_wb_anim.[MAX_CHANGED_OBJECTScxx . . $ `Descent3/multi_server.h:30:9`!][MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 36 | extern uint16_tcxx . . $ uint16_t# Num_changed_wb_animcxx . . $ Num_changed_wb_anim.[MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 37 | |
| 38 | extern int Changed_turretcxx . . $ Changed_turret.[MAX_CHANGED_OBJECTScxx . . $ `Descent3/multi_server.h:30:9`!][MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 39 | extern uint16_tcxx . . $ uint16_t# Num_changed_turretcxx . . $ Num_changed_turret.[MAX_NET_PLAYERScxx . . $ `Descent3/multi_external.h:132:9`!]; |
| 40 | |
| 41 | extern uint32_tcxx . . $ uint32_t# Secret_net_idcxx . . $ Secret_net_id.; |
| 42 | #define JOIN_ANSWER_OKcxx . . $ `Descent3/multi_server.h:42:9`! 0 |
| 43 | #define JOIN_ANSWER_NOT_SERVERcxx . . $ `Descent3/multi_server.h:43:9`! 1 |
| 44 | #define JOIN_ANSWER_REJECTEDcxx . . $ `Descent3/multi_server.h:44:9`! 2 |
| 45 | #define JOIN_ANSWER_NO_ROOMcxx . . $ `Descent3/multi_server.h:45:9`! 3 |
| 46 | #define JOIN_ANSWER_FULLcxx . . $ `Descent3/multi_server.h:46:9`! 4 |
| 47 | |
| 48 | // Does whatever the server needs to do for this frame |
| 49 | void MultiDoServerFramecxx . . $ MultiDoServerFrame(49f6e7a06ebc5aa8).(); |
| 50 | |
| 51 | // Set the local machine as a server |
| 52 | void MultiStartServercxx . . $ MultiStartServer(99469d7ff9a1485a).(int playing, char *scriptname, int dedicated_server_num_teams = -1); |
| 53 | |
| 54 | // Disconnects all players that haven't been heard from in a while |
| 55 | // Server only |
| 56 | void MultiDisconnectDeadPlayerscxx . . $ MultiDisconnectDeadPlayers(49f6e7a06ebc5aa8).(); |
| 57 | |
| 58 | // Disconnect a player for whatever reason |
| 59 | // Server only |
| 60 | void MultiDisconnectPlayercxx . . $ MultiDisconnectPlayer(d4f767463ce0a6b3).(int slot); |
| 61 | |
| 62 | // Sends existing players to a joining player |
| 63 | // Server only |
| 64 | void MultiSendPlayercxx . . $ MultiSendPlayer(3e454b8ccf442868).(int slot, int which); |
| 65 | |
| 66 | // Sends this reliable packet to everyone except the server and the named slot |
| 67 | void MultiSendReliablyToAllExceptcxx . . $ MultiSendReliablyToAllExcept(ff9a57d40a1b8fe8).(int except, uint8_tcxx . . $ uint8_t# *data, int size, int seq_threshold = 0, bool urgent = 1); |
| 68 | |
| 69 | // Tells clients to execute dlls on their machines |
| 70 | void MultiSendClientExecuteDLLcxx . . $ MultiSendClientExecuteDLL(cff815c6df1ba97c).(int eventnum, int me_objnum, int it_objnum, int to, dllinfocxx . . $ dllinfo# *info = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 71 | |
| 72 | // Resets the settings that a server uses |
| 73 | void MultiResetSettingscxx . . $ MultiResetSettings(49f6e7a06ebc5aa8).(); |
| 74 | |
| 75 | // Given a killer and killed player, calculates their new rankings |
| 76 | void GetNewRankingscxx . . $ GetNewRankings(6273fa812ac58a8).(objectcxx . . $ object# *killed, objectcxx . . $ object# *killer); |
| 77 | |
| 78 | // Returns a ranking index based on the player rating |
| 79 | // If rankbuf is non-null, fills in the string corresponding to that rank |
| 80 | // Returns -1 if not a pxo game (ie no rankings in this game) |
| 81 | int GetRankIndexcxx . . $ GetRankIndex(3c8082c546dd2ea0).(int pnum, char *rankbuf = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 82 | |
| 83 | #endif |