home *** CD-ROM | disk | FTP | other *** search
- #ifndef CONNECTION_H
- #define CONNECTION_H
-
- #include <Types.h>
- #include <MixedMode.h>
- #include <AppleEvents.h>
-
- #include "Global.h"
- #include "Rules.h"
-
- Boolean Connected (void);
- // Is there a net play going on?
-
- void InitConnection(void);
- // To be called at program init time to establish network connection
-
- OSErr ConnectionProtocol (void);
- // Performs the connection protocol.
-
- void ReSyncProtocol (void);
-
- void SynchronisationProtocol (short player);
- // When an out-of-sync is discovered with a certain player,
- // this protocol resets the board to the earliest of the two boards.
-
- void CancelNetPlay (void);
- //
-
- void BreakConnections (void);
- // Breaks all the current connections, and informs the other players of this.
-
- OSErr BroadcastMove (MovePtr move, short player, long checksum);
- // Sends the move to all known network players
-
-
- // Network address management functions
-
- Boolean IsConnected (short player);
- Boolean ConnectState (SettingsPtr settings, short player);
-
- AEAddressDesc *GetNetAddress (short player);
- // Returns the network address for the player
-
- void SetNetAddress (AEAddressDesc *address, short player);
- // Sets the network addres for the player.
- // MakeTarget can be used to get a valid network address
-
- void ClearNetAddress (short player);
-
- void MatchSettings (SettingsPtr sample, SettingsPtr destination);
- // Makes the settings such that they can be used to play against sample.
- // Destination samples are usually modified;
- // Sample settings may be modified as well to replace Mac players by humans.
-
- // Just for testing
- void DoNetTestMenu (short);
-
-
- #endif
-
-
- #ifdef CONNECTION_C
-
- #include "AEHandler.h"
- #include "AppleEvent.h"
- #include "Interface.h"
- #include "Define.h"
- #include "Global.h"
- #include "Settings.h"
-
-
- pascal Boolean AbalonePortFilter (LocationNamePtr locationName, PortInfoPtr thePortInfo);
- #endif