My Project
NPLTypes.h
1 #pragma once
2 //-----------------------------------------------------------------------------
3 // Copyright (C) 2007 - 2010 ParaEngine Corporation, All Rights Reserved.
4 // Date: 2009.6
5 // Author: LiXizhi
6 // Description: NPL Types
7 //-----------------------------------------------------------------------------
8 
9 #include <boost/noncopyable.hpp>
10 #include <boost/shared_ptr.hpp>
11 #include <boost/intrusive_ptr.hpp>
12 #include <boost/enable_shared_from_this.hpp>
13 
17 #define NPL_VERSION_MAJOR 1
18 #define NPL_VERSION_MINOR 0
19 
20 #ifndef ParaIntrusivePtr
21 #define ParaIntrusivePtr boost::intrusive_ptr
22 #endif
23 
24 namespace NPL
25 {
26  struct NPLAddress;
27  class CNPLConnection;
28  class CNPLConnectionManager;
29  class CNPLDispatcher;
30  struct NPLFileName;
31  class CNPLNetServer;
32  struct NPLMessage;
33  class CNPLMessageQueue;
34  struct NPLMsgHeader;
35  struct NPLMsgIn;
36  class NPLMsgIn_parser;
37  class NPLMsgOut;
38  class CNPLRuntime;
39  struct NPLRuntimeAddress;
40  class CNPLRuntimeState;
41  class CNPLScriptingState;
42  class NPLServerInfo;
43  class INPLStimulationPipe;
44  struct NPLTimer;
45 
46  typedef boost::shared_ptr<CNPLRuntimeState> NPLRuntimeState_ptr;
47  typedef boost::shared_ptr<NPLServerInfo> NPLServerInfo_ptr;
48  typedef ParaIntrusivePtr<NPLMessage> NPLMessage_ptr;
49  typedef boost::shared_ptr<NPLRuntimeAddress> NPLRuntimeAddress_ptr;
50  typedef boost::shared_ptr<NPLTimer> NPLTimer_ptr;
51 
52  //
53  // common data structures and forward declarations.
54  //
55 
56  enum NPLReturnCode
57  {
58  NPL_OK = 0,
59  NPL_Error,
60  NPL_ConnectionNotEstablished,
61  NPL_QueueIsFull,
62  NPL_StreamError,
63  NPL_RuntimeState_NotExist,
64  NPL_FailedToLoadFile,
65  NPL_RuntimeState_NotReady,
66  NPL_FileAccessDenied,
67  NPL_ConnectionEstablished,
68  NPL_UnableToResolveName,
69  NPL_ConnectionTimeout,
70  NPL_ConnectionDisconnected,
71  NPL_ConnectionAborted,
72  NPL_Command,
73  NPL_WrongProtocol
74  };
75 
81  {
92  };
93 
96  {
97  SYSTEM_PRIORITY,
98  HIGH_PRIORITY,
102  };
103 
107  {
108  UNRELIABLE,
113  };
114 }
This message is reliable and will arrive in the order you sent it. Messages will be delayed while wai...
Definition: NPLTypes.h:112
define this to enable debugging of NPL code in visual studio
Definition: INPL.h:9
NPLConnectionState
This describes the possible states of a NPLConnection object.
Definition: NPLTypes.h:80
The message is sent reliably, but not necessarily in any order. Same overhead as UNRELIABLE.
Definition: NPLTypes.h:111
PacketPriority
These enumerations are used to describe when packets are delivered.
Definition: NPLTypes.h:95
Regular UDP with a sequence counter. Out of order messages will be discarded. This adds an additional...
Definition: NPLTypes.h:110
socket is currently trying to establish a connection.
Definition: NPLTypes.h:85
Definition: class.hpp:124
socket is connected and being authenticated
Definition: NPLTypes.h:89
socket is connected and authenticated
Definition: NPLTypes.h:91
socket is connected to the server but authentication is not (yet) done.
Definition: NPLTypes.h:87
Same as regular UDP, except that it will also discard duplicate datagrams. The network layer adds (6 ...
Definition: NPLTypes.h:109
PacketReliability
These enumerations are used to describe how packets are delivered.
Definition: NPLTypes.h:106
socket is in disconnected state.
Definition: NPLTypes.h:83
Medium priority messages are send before low priority messages.
Definition: NPLTypes.h:100
Low priority messages are only sent when no other messages are waiting.
Definition: NPLTypes.h:101
High priority messages are send before medium priority messages.
Definition: NPLTypes.h:99