Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
ConnectionAcceptanceFilter.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#pragma once
13
14class WideStringClass;
15struct ConnectionRequest;
16
17
18class ConnectionAcceptanceFilter
19{
20public:
21 enum STATUS
22 {
23 // This filter has not yet decided about the acceptance of this client;
24 // should be returned from getStatus it is waiting for more data.
25 STATUS_INDETERMINATE,
26
27 // This filter has rejected the client. If any filter returns this value
28 // from getStatus, this client will be refused.
29 STATUS_REFUSING,
30
31 // The filter has accepted the client; if all filters eventually
32 // return this from getStatus, the client will be accepted.
33 STATUS_ACCEPTING,
34 };
35
36 // Called once for each request, before any other functions are called.
37 virtual void handleInitiation(const ConnectionRequest& connectionRequest) = 0;
38
39 // Called at most once for each request, when this filter accepted or refused the request, as well as after the call to handleCancellation.
40 virtual void handleTermination(const ConnectionRequest& connectionRequest) = 0;
41
42 // Called at most once for each request, when the request is cancelled due to one of the filters rejecting the request, or due to a broken connection.
43 virtual void handleCancellation(const ConnectionRequest& connectionRequest) = 0;
44
45 // Called every time the connection is checked for acceptance. connectionRequest may be updated in subsequent calls to include additional information that was fetched.
46 // Iff the returned status is STATUS_REFUSED, refusalMessage will be shown to the user.
47 virtual STATUS getStatus(const ConnectionRequest& connectionRequest, WideStringClass& refusalMessage) = 0;
48};