|
virtual bool | CloseConnection (HostID clientHostID)=0 |
|
virtual void | CloseEveryConnection ()=0 |
|
virtual HostID | CreateP2PGroup (const HostID *clientHostIDs, int count, ByteArray message=ByteArray(), CP2PGroupOption &option=CP2PGroupOption::Default, HostID assignedHostID=HostID_None)=0 |
|
HostID | CreateP2PGroup (ByteArray message=ByteArray(), CP2PGroupOption &option=CP2PGroupOption::Default, HostID assignedHostID=HostID_None) |
|
HostID | CreateP2PGroup (HostID memberID, ByteArray message=ByteArray(), CP2PGroupOption &option=CP2PGroupOption::Default, HostID assignedHostID=HostID_None) |
|
virtual bool | DestroyP2PGroup (HostID groupHostID)=0 |
|
virtual void | DestroyEmptyP2PGroups ()=0 |
|
virtual String | DumpGroupStatus ()=0 |
|
virtual int | GetClientCount ()=0 |
|
virtual void | GetStats (CNetServerStats &outVal)=0 |
|
virtual int | GetClientHostIDs (HostID *output, int outputLength)=0 |
|
virtual bool | GetJoinedP2PGroups (HostID clientHostID, HostIDArray &output)=0 |
|
double | GetLastPingSec (HostID clientID, ErrorType *error=NULL) |
|
virtual int | GetLastUnreliablePingMs (HostID clientID, ErrorType *error=NULL)=0 |
|
double | GetRecentPingSec (HostID clientID, ErrorType *error=NULL) |
|
virtual int | GetRecentUnreliablePingMs (HostID clientID, ErrorType *error=NULL)=0 |
|
virtual int | GetP2PRecentPingMs (HostID HostA, HostID HostB)=0 |
|
virtual bool | GetP2PGroupInfo (HostID groupHostID, CP2PGroup &output)=0 |
|
virtual bool | IsValidHostID (HostID id)=0 |
|
virtual void | GetP2PGroups (CP2PGroups &output)=0 |
|
virtual int | GetP2PGroupCount ()=0 |
|
virtual bool | GetClientInfo (HostID clientHostID, CNetClientInfo &output)=0 |
|
virtual bool | IsConnectedClient (HostID clientHostID)=0 |
|
PN_DEPRECATED bool | GetPeerInfo (HostID clientHostID, CNetClientInfo &output) |
|
virtual bool | SetHostTag (HostID hostID, void *hostTag)=0 |
|
virtual int64_t | GetTimeMs ()=0 |
|
virtual bool | JoinP2PGroup (HostID memberHostID, HostID groupHostID, ByteArray message=ByteArray())=0 |
|
virtual bool | LeaveP2PGroup (HostID memberHostID, HostID groupHostID)=0 |
|
virtual void | SetEventSink (INetServerEvent *eventSink)=0 |
|
virtual void | Start (CStartServerParameter ¶m)=0 |
|
virtual void | Start (CStartServerParameter ¶m, ErrorInfoPtr &outError)=0 |
|
virtual void | Stop ()=0 |
|
virtual void | AllowEmptyP2PGroup (bool enable)=0 |
|
virtual bool | IsEmptyP2PGroupAllowed () const =0 |
|
virtual void | GetRemoteIdentifiableLocalAddrs (CFastArray< NamedAddrPort > &output)=0 |
|
virtual void | GetTcpListenerLocalAddrs (CFastArray< AddrPort > &output)=0 |
|
virtual void | GetUdpListenerLocalAddrs (CFastArray< AddrPort > &output)=0 |
|
virtual void | SetDefaultTimeoutTimeMs (int newValInMs)=0 |
|
virtual void | SetTimeoutTimeMs (HostID host, int newValInMs)=0 |
|
virtual void | SetDefaultAutoConnectionRecoveryTimeoutTimeMs (int newValInMs)=0 |
|
virtual void | SetAutoConnectionRecoveryTimeoutTimeMs (HostID host, int newValInMs)=0 |
|
virtual void | SetDefaultFallbackMethod (FallbackMethod newValue)=0 |
|
virtual void | EnableLog (const PNTCHAR *logFileName)=0 |
|
virtual void | DisableLog ()=0 |
|
virtual void | SetSpeedHackDetectorReckRatioPercent (int newValue)=0 |
|
virtual bool | EnableSpeedHackDetector (HostID clientID, bool enable)=0 |
|
virtual void | SetMessageMaxLength (int value_s, int value_c)=0 |
|
virtual bool | IsNagleAlgorithmEnabled ()=0 |
|
virtual void | SetMaxDirectP2PConnectionCount (HostID clientID, int newVal)=0 |
|
virtual bool | SetDirectP2PStartCondition (DirectP2PStartCondition newVal)=0 |
|
virtual HostID | GetMostSuitableSuperPeerInGroup (HostID groupID, const CSuperPeerSelectionPolicy &policy=CSuperPeerSelectionPolicy::GetOrdinary(), const HostID *excludees=NULL, intptr_t excludeesLength=0)=0 |
|
virtual HostID | GetMostSuitableSuperPeerInGroup (HostID groupID, const CSuperPeerSelectionPolicy &policy, HostID excludee)=0 |
|
virtual int | GetSuitableSuperPeerRankListInGroup (HostID groupID, SuperPeerRating *ratings, int ratingsBufferCount, const CSuperPeerSelectionPolicy &policy=CSuperPeerSelectionPolicy::GetOrdinary(), const CFastArray< HostID > &excludees=CFastArray< HostID >())=0 |
|
virtual void | GetUdpSocketAddrList (CFastArray< AddrPort > &output)=0 |
|
virtual int | GetInternalVersion ()=0 |
|
virtual bool | GetP2PConnectionStats (HostID remoteHostID, CP2PConnectionStats &status)=0 |
|
virtual bool | GetP2PConnectionStats (HostID remoteA, HostID remoteB, CP2PPairConnectionStats &status)=0 |
|
virtual void | GetUserWorkerThreadInfo (CFastArray< CThreadInfo > &output)=0 |
|
virtual void | GetNetWorkerThreadInfo (CFastArray< CThreadInfo > &output)=0 |
|
virtual bool | SendUserMessage (const HostID *remotes, int remoteCount, RmiContext &rmiContext, uint8_t *payload, int payloadLength)=0 |
|
bool | SendUserMessage (HostID remote, RmiContext &rmiContext, uint8_t *payload, int payloadLength) |
|
virtual ErrorType | SetCoalesceIntervalMs (HostID remote, int intervalMs)=0 |
|
|
|
virtual ErrorType | SetCoalesceIntervalToAuto (HostID remote)=0 |
|
|
|
virtual void | TEST_SetOverSendSuspectingThresholdInBytes (int newVal)=0 |
|
virtual void | TEST_SetTestping (HostID hostID0, HostID hostID1, int ping)=0 |
|
virtual void | TEST_ForceDenyTcpConnection ()=0 |
|
virtual ErrorType | GetUnreliableMessagingLossRatioPercent (HostID remotePeerID, int *outputPercent)=0 |
|
virtual void | AttachProxy (IRmiProxy *proxy)=0 |
|
void | AttachProxy (IRmiProxy *proxy, ErrorInfoPtr &outError) |
|
virtual void | AttachStub (IRmiStub *stub)=0 |
|
void | AttachStub (IRmiStub *stub, ErrorInfoPtr &outError) |
|
virtual void | DetachProxy (IRmiProxy *proxy)=0 |
|
void | DetachProxy (IRmiProxy *proxy, ErrorInfoPtr &outError) |
|
virtual void | DetachStub (IRmiStub *stub)=0 |
|
void | DetachStub (IRmiStub *stub, ErrorInfoPtr &outError) |
|
virtual void | SetTag (void *value)=0 |
|
virtual void * | GetTag ()=0 |
|
virtual bool | RunAsyncInternal (HostID taskOwner, LambdaBase_Param0< void > *func)=0 |
|
virtual bool | IsSimplePacketMode ()=0 |
|
virtual void | ShowError_NOCSLOCK (ErrorInfoPtr errorInfo)=0 |
|
virtual void | ShowNotImplementedRmiWarning (const PNTCHAR *RMIName)=0 |
|
virtual void | PostCheckReadMessage (CMessage &msg, const PNTCHAR *RMIName)=0 |
|
virtual CriticalSection & | GetCriticalSection ()=0 |
|
|
LambdaBaseHolder_Param1< void,
CNetClientInfo * > | OnClientJoin |
| See Proud.INetServerEvent.OnClientJoin for details.
|
|
LambdaBaseHolder_Param3< void,
CNetClientInfo *, ErrorInfo
*, const ByteArray & > | OnClientLeave |
| See Proud.INetServerEvent.OnClientLeave for details.
|
|
LambdaBaseHolder_Param2< void,
HostID, HackType > | OnClientHackSuspected |
| See Proud.INetServerEvent.OnClientHackSuspected for details.
|
|
LambdaBaseHolder_Param1< void,
CRemoteOfflineEventArgs & > | OnClientOffline |
| See Proud.INetServerEvent.OnClientOffline for details.
|
|
LambdaBaseHolder_Param1< void,
CRemoteOnlineEventArgs & > | OnClientOnline |
| See Proud.INetServerEvent.OnClientOnline for details.
|
|
LambdaBaseHolder_Param4< void,
AddrPort, ByteArray
&, ByteArray &, bool * > | OnConnectionRequest |
| See Proud.INetServerEvent.OnConnectionRequest for details.
|
|
LambdaBaseHolder_Param3< void,
HostID, HostID, ErrorType > | OnP2PGroupJoinMemberAckComplete |
| See Proud.INetServerEvent.OnP2PGroupJoinMemberAckComplete for details.
|
|
LambdaBaseHolder_Param1< void,
HostID > | OnP2PGroupRemoved |
| See Proud.INetServerEvent.OnP2PGroupRemoved for details.
|
|
LambdaBaseHolder_Param0< void > | OnUserWorkerThreadBegin |
| See Proud.INetServerEvent.OnUserWorkerThreadBegin for details.
|
|
LambdaBaseHolder_Param0< void > | OnUserWorkerThreadEnd |
| See Proud.INetServerEvent.OnUserWorkerThreadEnd for details.
|
|
LambdaBaseHolder_Param1< void,
ErrorInfo * > | OnError |
| See Proud.INetCoreEvent.OnError for details.
|
|
LambdaBaseHolder_Param1< void,
const Exception & > | OnException |
| See Proud.INetCoreEvent.OnException for details.
|
|
LambdaBaseHolder_Param1< void,
ErrorInfo * > | OnInformation |
| See Proud.INetCoreEvent.OnInformation for details.
|
|
LambdaBaseHolder_Param1< void,
RmiID > | OnNoRmiProcessed |
| See Proud.INetCoreEvent.OnNoRmiProcessed for details.
|
|
LambdaBaseHolder_Param4< void,
HostID, const RmiContext
&, uint8_t *, int > | OnReceiveUserMessage |
| See Proud.INetCoreEvent.OnReceiveUserMessage for details.
|
|
LambdaBaseHolder_Param1< void,
ErrorInfo * > | OnWarning |
| See Proud.INetCoreEvent.OnWarning for details.
|
|
LambdaBaseHolder_Param1< void,
void * > | OnTick |
| See Proud.INetCoreEvent.OnTick for details.
|
|
LambdaBaseHolder_Param0< void > | OnUserWorkerThreadCallbackBegin |
| See Proud.INetCoreEvent.OnUserWorkerThreadCallbackBegin for details.
|
|
LambdaBaseHolder_Param0< void > | OnUserWorkerThreadCallbackEnd |
| See Proud.INetCoreEvent.OnUserWorkerThreadCallbackEnd for details.
|
|
Gaming network server.
A network server for gaming. Please refer to ProudNet Server.
- Can be used for a MMO title
- Receives CNetClient connection
- Allocates HostID to client
- Allows RMI requires HostID
- Basic options are set in order to support what a general game server needs
- Supports P2P connection between clients. This server object supports to be a rela server when P2P connection fails between clients.
General usage
Creating P2P connection group
- The client connected to CNetServer can create 1 or more P2P group. Among the clients linked as P2P group can transmit/receive RMI as HostID being index.
- Creating/removing a new P2P group: Only server has rights. OnP2PMemberJoin and so on will be called at client via CreateP2PGroup(),DestroyP2PGroup().
- Adding/removig peer to/from existing P2P group: JoinP2PGroup(), LeaveP2PGroup(). OnP2PMemberJoin and so on will be called at client.
Roles as relay server
- As long as using HostID, P2P connection occurs virtually as well. For an example, even if the opponent is a member of P2P group, between clients that P2P connection was not successful in real then RMI is successfully sent to opponent's HostID. Relay server manages the carrying. Tough for same RMI reception message, it is to read RmiContext.m_relayed at RMI read part to get whether went through relay server.
Thread pooling
- Basically uses thread pool. So there must be at least 1 or more thread when server starts.
- When turning thread pooling off is better: server with 1 CPU and all it does is CPU time process (e.g. relay server)
- When turning thread pooling on is better: server with multip CPU or server that has often device time process (e.g. MMO game server)
- Since thread pool function is called when CoInitialize()is ready there is no need to call CoInitialize() or CoUninitialize().
Server performance related to number of UDP host port
- Can designate number of UDP host port as server port parameter of CNetServer.Start Client will be connected to one of the ports among parameter when connected to server.
Success rate of P2P direct communication note
- Direct P2P communication will be successful when an end of P2P is real IP, Full-cone NAT.
- When game server operatedbehind NAT it is necessary to enter server address to Start(). (Please refer Start() manual.) However, there will be no direct P2P communication between the client run by other host that is in front of game server and behind of NAT and the client of outer internet. This is because the internal IP of NAT will be recognized other than outer internet address by NAT device in server.