1 /* 2 * StarGameProtocol.h 3 4 Copyright (C) 2003 and beyond by Woody Zenfell, III 5 and the "Aleph One" developers. 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 This license is contained in the file "COPYING", 18 which is included with this source code; it is available online at 19 http://www.gnu.org/licenses/gpl.html 20 21 * Created by Woody Zenfell, III on Sat May 17 2003. 22 * 23 * Interface between the star-topology game protocol module and the rest of the code. 24 */ 25 26 #ifndef STARGAMEPROTOCOL_H 27 #define STARGAMEPROTOCOL_H 28 29 #include "NetworkGameProtocol.h" 30 31 #include <stdio.h> 32 33 class InfoTree; 34 35 class StarGameProtocol : public NetworkGameProtocol 36 { 37 public: 38 bool Enter(short* inNetStatePtr); 39 void Exit1(); 40 void Exit2(); 41 void DistributeInformation(short type, void *buffer, short buffer_size, bool send_to_self, bool only_send_to_team); 42 bool Sync(NetTopology* inTopology, int32 inSmallestGameTick, size_t inLocalPlayerIndex, size_t inServerPlayerIndex); 43 bool UnSync(bool inGraceful, int32 inSmallestPostgameTick); 44 int32 GetNetTime(); 45 void PacketHandler(DDPPacketBuffer* inPacket); 46 47 static void ParsePreferencesTree(InfoTree prefs, std::string version); 48 49 int32 GetUnconfirmedActionFlagsCount(); 50 uint32 PeekUnconfirmedActionFlag(int32 offset); 51 void UpdateUnconfirmedActionFlags(); 52 }; 53 54 extern void DefaultStarPreferences(); 55 InfoTree StarPreferencesTree(); 56 57 #endif // STARGAMEPROTOCOL_H 58