]> icculus.org git repositories - taylor/freespace2.git/blob - include/valid.h
re-add PXO sources to project files
[taylor/freespace2.git] / include / valid.h
1 /*
2  * Copyright (C) Volition, Inc. 2005.  All rights reserved.
3  * 
4  * All source code herein is the property of Volition, Inc. You may not sell 
5  * or otherwise commercially exploit the source or things you created based on the 
6  * source.
7  *
8 */
9
10
11 #ifndef _valid_client_header
12 #define _valid_client_header
13
14 #include "ptrack.h"
15
16 //Validate User Header
17
18 //Function prototypes
19
20
21 //Call with a valid struct to validate a user
22 //Call with NULL to poll
23
24 //Return codes:
25 // -3   Still waiting (returned if we were waiting for a tracker response and ValidateUser was called with a non-NULL value
26 // -2 Timeout waiting for tracker to respond
27 // -1   User invalid
28 //  0   Still waiting for response from tracker/Idle
29 //  1   User valid
30 int ValidateUser(validate_id_request *valid_id, char *trackerid);
31 void AckValidServer(unsigned int sig);
32
33 int InitValidateClient(void);
34 void ValidIdle();
35
36
37 //Definitions
38
39
40 // #define PILOT_REQ_TIMEOUT                    10000
41 // #define PILOT_REQ_RESEND_TIME                750
42
43 #define VALID_STATE_IDLE                1
44 #define VALID_STATE_WAITING     2
45 #define VALID_STATE_VALID               3
46 #define VALID_STATE_INVALID     4
47 #define VALID_STATE_TIMEOUT     5
48
49 typedef struct vmt_validate_mission_req_struct {
50         unsigned int checksum;
51         char file_name[100];
52 } vmt_validate_mission_req_struct;
53
54 // query the usertracker to validate a mission
55 int ValidateMission(vmt_validate_mission_req_struct *valid_msn);
56
57 // query the usertracker to validate a squad war match
58 int ValidateSquadWar(squad_war_request *sw_req, squad_war_response *sw_resp);
59
60 #endif