Photon Server API

Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Properties | List of all members
Photon.Hive.Tests.TcpTests Class Reference

The test base. More...

Public Member Functions

 TcpTests ()
 Initializes a new instance of the TcpTests class. More...
 
void Join ()
 The join. More...
 
void JoinWithChannel ()
 The join with channel. More...
 
virtual void JoinWithPropertiesInt ()
 The join with properties int. More...
 
void JoinWithPropertiesString ()
 The join with properties string. More...
 
void JoinWithPropertyBroadcast ()
 The join with property broadcast. More...
 
void SendCustomEvent ()
 The send custom event. More...
 
void SendCustomEventToActorList ()
 Sends a custom event to a list of actors. More...
 
virtual void SendCustomEventWithLargeData ()
 The send custom event with large data. More...
 
void SendPing ()
 The send ping. More...
 
virtual void SetPropertiesWithBroadcast ()
 The set properties with broadcast. More...
 
virtual void SetPropertiesWithBroadcastV15 ()
 The set properties with broadcast v 15. More...
 

Protected Types

enum  PropertyKeys { PropertyKeys.ActorName, PropertyKeys.ActorAge, PropertyKeys.RoomColor, PropertyKeys.RoomTemperature }
 The property keys. More...
 

Protected Member Functions

virtual object GetActorNumberKey (int actorNumber)
 The get actor number key. More...
 
virtual TestClient InitClient ()
 The init client. More...
 
void JoinClientsToRoom (string roomName, TestClient client1, TestClient client2)
 The join clients to room. More...
 
void JoinClientsToRoom (string roomName, TestClient client1, TestClient client2, Hashtable clientProperties1, Hashtable clientProperties2, bool broadcastClientProperties)
 The join clients to room. More...
 
void LeaveClientsFromRoom (TestClient client1, TestClient client2)
 The leave clients from room. More...
 
void LogElapsedTime (ILogger logger, string prefix, TimeSpan elapsedTime, long numItems)
 The log elapsed time. More...
 

Static Protected Member Functions

static void CheckDefaultEventParameters (EventData eventArgs, OperationCode operationCode, int actorNumber)
 The check default event params. More...
 
static void CheckDefaultEventParameters (EventData eventArgs, EventCode eventEventCode, int actorNumber)
 The check default event params. More...
 
static void CheckDefaultOperationParameters (OperationResponse response, OperationCode operationCode)
 The check default operation params. More...
 
static void CheckEventParam (EventData eventArgs, ParameterKey paramKey, object expectedValue)
 The check event param. More...
 
static void CheckEventParam (EventData eventArgs, object key, object expectedValue)
 The check event param. More...
 
static void CheckEventParamExists (EventData eventArgs, ParameterKey paramKey)
 The check event param exists. More...
 
static void CheckEventParamExists (EventData eventArgs, object key)
 The check event param exists. More...
 
static void CheckJoinEvent (EventData eventArgs, int actorNumber)
 The check join event. More...
 
static void CheckJoinEvent (EventData eventArgs, int actorNumber, Hashtable expectedActorProperties)
 The check join event. More...
 
static void CheckJoinResponse (OperationResponse operationResponse, int expectedActorNumber)
 The check join response. More...
 
static void CheckParam (OperationResponse response, ParameterKey paramKey, object expectedValue)
 The check param. More...
 
static void CheckParamExists (OperationResponse response, ParameterKey paramKey)
 The check param exists. More...
 
static byte[] CreateByteArrayFromHexString (string hexString, char delimiter)
 Converts a hex string to an byte array. More...
 
static OperationRequest CreateJoinRequest (string roomName, Hashtable properties, bool broadcastProperties)
 The create join request. More...
 
static string CreateRandomRoomName ()
 The create random room name. More...
 

Properties

int WaitTime [get, set]
 Gets or sets WaitTime. More...
 

Detailed Description

The test base.

Member Enumeration Documentation

◆ PropertyKeys

The property keys.

Enumerator
ActorName 

The actor name.

ActorAge 

The actor age.

RoomColor 

The room color.

RoomTemperature 

The room temperature.

Constructor & Destructor Documentation

◆ TcpTests()

Photon.Hive.Tests.TcpTests.TcpTests ( )
inline

Initializes a new instance of the TcpTests class.

Member Function Documentation

◆ CheckDefaultEventParameters() [1/2]

static void Photon.Hive.Tests.TcpTests.CheckDefaultEventParameters ( EventData  eventArgs,
EventCode  eventEventCode,
int  actorNumber 
)
inlinestaticprotected

The check default event params.

Parameters
eventArgsThe event args.
eventEventCodeThe event code.
actorNumberThe actor number.

◆ CheckDefaultEventParameters() [2/2]

static void Photon.Hive.Tests.TcpTests.CheckDefaultEventParameters ( EventData  eventArgs,
OperationCode  operationCode,
int  actorNumber 
)
inlinestaticprotected

The check default event params.

Parameters
eventArgsThe event args.
operationCodeThe operation code.
actorNumberThe actor number.

◆ CheckDefaultOperationParameters()

static void Photon.Hive.Tests.TcpTests.CheckDefaultOperationParameters ( OperationResponse  response,
OperationCode  operationCode 
)
inlinestaticprotected

The check default operation params.

Parameters
responseThe response.
operationCodeThe operation code.

◆ CheckEventParam() [1/2]

static void Photon.Hive.Tests.TcpTests.CheckEventParam ( EventData  eventArgs,
object  key,
object  expectedValue 
)
inlinestaticprotected

The check event param.

Parameters
eventArgsThe event args.
keyThe key.
expectedValueThe expected value.

◆ CheckEventParam() [2/2]

static void Photon.Hive.Tests.TcpTests.CheckEventParam ( EventData  eventArgs,
ParameterKey  paramKey,
object  expectedValue 
)
inlinestaticprotected

The check event param.

Parameters
eventArgsThe event args.
paramKeyThe param key.
expectedValueThe expected value.

◆ CheckEventParamExists() [1/2]

static void Photon.Hive.Tests.TcpTests.CheckEventParamExists ( EventData  eventArgs,
object  key 
)
inlinestaticprotected

The check event param exists.

Parameters
eventArgsThe event args.
keyThe key.

◆ CheckEventParamExists() [2/2]

static void Photon.Hive.Tests.TcpTests.CheckEventParamExists ( EventData  eventArgs,
ParameterKey  paramKey 
)
inlinestaticprotected

The check event param exists.

Parameters
eventArgsThe event args.
paramKeyThe param key.

◆ CheckJoinEvent() [1/2]

static void Photon.Hive.Tests.TcpTests.CheckJoinEvent ( EventData  eventArgs,
int  actorNumber 
)
inlinestaticprotected

The check join event.

Parameters
eventArgsThe event args.
actorNumberThe actor number.

◆ CheckJoinEvent() [2/2]

static void Photon.Hive.Tests.TcpTests.CheckJoinEvent ( EventData  eventArgs,
int  actorNumber,
Hashtable  expectedActorProperties 
)
inlinestaticprotected

The check join event.

Parameters
eventArgsThe event args.
actorNumberThe actor number.
expectedActorPropertiesThe expected actor properties.

◆ CheckJoinResponse()

static void Photon.Hive.Tests.TcpTests.CheckJoinResponse ( OperationResponse  operationResponse,
int  expectedActorNumber 
)
inlinestaticprotected

The check join response.

Parameters
operationResponseThe operation response.
expectedActorNumberThe expected actor number.

◆ CheckParam()

static void Photon.Hive.Tests.TcpTests.CheckParam ( OperationResponse  response,
ParameterKey  paramKey,
object  expectedValue 
)
inlinestaticprotected

The check param.

Parameters
responseThe response.
paramKeyThe param key.
expectedValueThe expected value.

◆ CheckParamExists()

static void Photon.Hive.Tests.TcpTests.CheckParamExists ( OperationResponse  response,
ParameterKey  paramKey 
)
inlinestaticprotected

The check param exists.

Parameters
responseThe response.
paramKeyThe param key.

◆ CreateByteArrayFromHexString()

static byte [] Photon.Hive.Tests.TcpTests.CreateByteArrayFromHexString ( string  hexString,
char  delimiter 
)
inlinestaticprotected

Converts a hex string to an byte array.

Parameters
hexStringThe hex string.
delimiterThe delimiter between the hex values.
Returns
A byte array.

◆ CreateJoinRequest()

static OperationRequest Photon.Hive.Tests.TcpTests.CreateJoinRequest ( string  roomName,
Hashtable  properties,
bool  broadcastProperties 
)
inlinestaticprotected

The create join request.

Parameters
roomNameThe room name.
propertiesThe properties.
broadcastPropertiesThe broadcast properties.
Returns
the join request

◆ CreateRandomRoomName()

static string Photon.Hive.Tests.TcpTests.CreateRandomRoomName ( )
inlinestaticprotected

The create random room name.

Returns
The random room name.

◆ GetActorNumberKey()

virtual object Photon.Hive.Tests.TcpTests.GetActorNumberKey ( int  actorNumber)
inlineprotectedvirtual

The get actor number key.

Parameters
actorNumberThe actor number.
Returns
The actor number key.

◆ InitClient()

virtual TestClient Photon.Hive.Tests.TcpTests.InitClient ( )
inlineprotectedvirtual

The init client.

Returns
the test client

◆ Join()

void Photon.Hive.Tests.TcpTests.Join ( )
inline

The join.

◆ JoinClientsToRoom() [1/2]

void Photon.Hive.Tests.TcpTests.JoinClientsToRoom ( string  roomName,
TestClient  client1,
TestClient  client2 
)
inlineprotected

The join clients to room.

Parameters
roomNameThe room name.
client1The client 1.
client2The client 2.

◆ JoinClientsToRoom() [2/2]

void Photon.Hive.Tests.TcpTests.JoinClientsToRoom ( string  roomName,
TestClient  client1,
TestClient  client2,
Hashtable  clientProperties1,
Hashtable  clientProperties2,
bool  broadcastClientProperties 
)
inlineprotected

The join clients to room.

Parameters
roomNameThe room name.
client1The client 1.
client2The client 2.
clientProperties1The client properties 1.
clientProperties2The client properties 2.
broadcastClientPropertiesThe broadcast client properties.

◆ JoinWithChannel()

void Photon.Hive.Tests.TcpTests.JoinWithChannel ( )
inline

The join with channel.

◆ JoinWithPropertiesInt()

virtual void Photon.Hive.Tests.TcpTests.JoinWithPropertiesInt ( )
inlinevirtual

The join with properties int.

◆ JoinWithPropertiesString()

void Photon.Hive.Tests.TcpTests.JoinWithPropertiesString ( )
inline

The join with properties string.

◆ JoinWithPropertyBroadcast()

void Photon.Hive.Tests.TcpTests.JoinWithPropertyBroadcast ( )
inline

The join with property broadcast.

◆ LeaveClientsFromRoom()

void Photon.Hive.Tests.TcpTests.LeaveClientsFromRoom ( TestClient  client1,
TestClient  client2 
)
inlineprotected

The leave clients from room.

Parameters
client1The client 1.
client2The client 2.

◆ LogElapsedTime()

void Photon.Hive.Tests.TcpTests.LogElapsedTime ( ILogger  logger,
string  prefix,
TimeSpan  elapsedTime,
long  numItems 
)
inlineprotected

The log elapsed time.

Parameters
loggerThe logger.
prefixThe prefix.
elapsedTimeThe elapsed time.
numItemsThe num items.

◆ SendCustomEvent()

void Photon.Hive.Tests.TcpTests.SendCustomEvent ( )
inline

The send custom event.

◆ SendCustomEventToActorList()

void Photon.Hive.Tests.TcpTests.SendCustomEventToActorList ( )
inline

Sends a custom event to a list of actors.

◆ SendCustomEventWithLargeData()

virtual void Photon.Hive.Tests.TcpTests.SendCustomEventWithLargeData ( )
inlinevirtual

The send custom event with large data.

◆ SendPing()

void Photon.Hive.Tests.TcpTests.SendPing ( )
inline

The send ping.

◆ SetPropertiesWithBroadcast()

virtual void Photon.Hive.Tests.TcpTests.SetPropertiesWithBroadcast ( )
inlinevirtual

The set properties with broadcast.

◆ SetPropertiesWithBroadcastV15()

virtual void Photon.Hive.Tests.TcpTests.SetPropertiesWithBroadcastV15 ( )
inlinevirtual

The set properties with broadcast v 15.

Property Documentation

◆ WaitTime

int Photon.Hive.Tests.TcpTests.WaitTime
getsetprotected

Gets or sets WaitTime.