本文整理汇总了C#中ReceiveDataReader.ReadVariableUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDataReader.ReadVariableUInt32方法的具体用法?C# ReceiveDataReader.ReadVariableUInt32怎么用?C# ReceiveDataReader.ReadVariableUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReceiveDataReader
的用法示例。
在下文中一共展示了ReceiveDataReader.ReadVariableUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReceiveMessage_TextToClient
bool ReceiveMessage_TextToClient( NetworkNode.ConnectedNode sender,
MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage )
{
//get data from message
uint fromUserIdentifier = reader.ReadVariableUInt32();
string text = reader.ReadString();
if( !reader.Complete() )
return false;
//get user by identifier
UserManagementClientNetworkService.UserInfo fromUser = userManagementService.GetUser(
fromUserIdentifier );
if( fromUser == null )
{
//error. no such user.
return true;
}
if( ReceiveText != null )
ReceiveText( this, fromUser, text );
return true;
}
示例2: ReceiveMessage_TextToServer
private bool ReceiveMessage_TextToServer(NetworkNode.ConnectedNode sender,
MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
{
//get source user
UserManagementServerNetworkService.UserInfo fromUser = userManagementService.
GetUser(sender);
//get data of message
string text = reader.ReadString();
uint privateToUserIdentifier = reader.ReadVariableUInt32();
if (!reader.Complete())
return false;
//send text to the clients
if (privateToUserIdentifier != 0)
{
//send text to the specific user
UserManagementServerNetworkService.UserInfo privateToUser = userManagementService.
GetUser(privateToUserIdentifier);
if (privateToUser != null)
{
SendText(fromUser, text, privateToUser);
}
else
{
//no user anymore
}
}
else
{
SendText(fromUser, text, null);
}
return true;
}
示例3: Client_ReceiveCreateSplash
void Client_ReceiveCreateSplash( RemoteEntityWorld sender, ReceiveDataReader reader )
{
WaterPlaneType.SplashTypes splashType = (WaterPlaneType.SplashTypes)reader.
ReadVariableUInt32();
Vec3 pos = reader.ReadVec3();
if( !reader.Complete() )
return;
CreateSplash( splashType, pos );
}
示例4: Client_ReceiveUpdateData
void Client_ReceiveUpdateData( RemoteEntityWorld sender, ReceiveDataReader reader )
{
while( reader.BitPosition < reader.EndBitPosition )
{
uint identifier = reader.ReadVariableUInt32();
int frags = reader.ReadVariableInt32();
float ping = reader.ReadSingle();
Client_Player player = Client_GetPlayer( identifier );
if( player != null )
{
player.Frags = frags;
player.Ping = ping;
}
}
}
示例5: Client_ReceiveRemoveUser
void Client_ReceiveRemoveUser( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint identifier = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
Client_Player player = Client_GetPlayer( identifier );
if( player == null )
return;
client_players.Remove( player );
}
示例6: Client_ReceiveUpdateData
private void Client_ReceiveUpdateData(RemoteEntityWorld sender, ReceiveDataReader reader)
{
while (reader.BitPosition < reader.EndBitPosition)
{
uint identifier = reader.ReadVariableUInt32();
int hitPoints = reader.ReadVariableInt32();
int killPoints = reader.ReadVariableInt32();
int assaultCredits = reader.ReadVariableInt32();
float ping = reader.ReadSingle();
Client_Player player = Client_GetPlayer(identifier);
if (player != null)
{
player.HitPoints = hitPoints;
player.KillPoints = killPoints;
player.AssaultCredits = assaultCredits;
player.Ping = ping;
}
}
}
示例7: Client_ReceiveActiveWeapon
void Client_ReceiveActiveWeapon( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint networkUIN = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
Weapon value = (Weapon)Entities.Instance.GetByNetworkUIN( networkUIN );
if( activeWeaponAttachedObject != null )
{
Detach( activeWeaponAttachedObject );
activeWeaponAttachedObject = null;
}
activeWeapon = value;
if( activeWeapon != null )
CreateActiveWeaponAttachedObject();
}
示例8: ReceiveMessage_AddUserToClient
private bool ReceiveMessage_AddUserToClient(NetworkNode.ConnectedNode sender,
MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
{
//get data from message
uint identifier = reader.ReadVariableUInt32();
string name = reader.ReadString();
bool thisUserFlag = reader.ReadBoolean();
if (!reader.Complete())
return false;
AddUser(identifier, name, thisUserFlag);
return true;
}
示例9: Server_ReceiveChangeMainControlledUnit
void Server_ReceiveChangeMainControlledUnit( RemoteEntityWorld sender,
ReceiveDataReader reader)
{
//not safe. client can send networkUIN of any unit from any place.
//check to ensure that other players can not send messages to another player
if( !Server_CheckRemoteEntityWorldAssociatedWithThisIntellect( sender ) )
return;
uint unitNetworkUIN = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
Unit unit = Entities.Instance.GetByNetworkUIN( unitNetworkUIN ) as Unit;
//unit is not exists
if( unit == null )
return;
ServerOrSingle_ChangeMainControlledUnit( unit );
}
示例10: Client_ReceiveSetInstance
void Client_ReceiveSetInstance( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint networkUIN = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
Entity entity = Entities.Instance.GetByNetworkUIN( networkUIN );
SetInstance( (PlayerIntellect)entity );
}
示例11: Client_ReceiveMainNotActiveUnit
void Client_ReceiveMainNotActiveUnit( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint networkUIN = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
if( mainNotActiveUnit != null )
mainNotActiveUnit.Visible = true;
mainNotActiveUnit = Entities.Instance.GetByNetworkUIN( networkUIN ) as Unit;
}
示例12: Client_ReceiveIntellect
private void Client_ReceiveIntellect(RemoteEntityWorld sender, ReceiveDataReader reader)
{
uint networkUIN = reader.ReadVariableUInt32();
bool shouldDeleteAfterDetach = reader.ReadBoolean();
FactionType ft = null;
if (GameMap.Instance.GameType == GameMap.GameTypes.AssaultKnights)
{
string factionName = reader.ReadString();
if (factionName != string.Empty)
ft = (FactionType)EntityTypes.Instance.GetByName(factionName);
}
if (!reader.Complete())
return;
Intellect i = null;
if (networkUIN != 0)
{
i = (Intellect)Entities.Instance.GetByNetworkUIN(networkUIN);
if (ft != null)
i.Faction = ft;
}
SetIntellect(i, shouldDeleteAfterDetach);
}
示例13: Client_ReceiveDieCall
void Client_ReceiveDieCall( RemoteEntityWorld sender, ReceiveDataReader reader )
{
MapObject prejudicial = Entities.Instance.GetByNetworkUIN( reader.ReadVariableUInt32() ) as MapObject;
bool allowLatencyTime = reader.ReadBoolean();
if( !reader.Complete() )
return;
Die( prejudicial, allowLatencyTime );
}
示例14: Client_ReceiveGameType
void Client_ReceiveGameType( RemoteEntityWorld sender, ReceiveDataReader reader )
{
GameTypes value = (GameTypes)reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
gameType = value;
}
示例15: Client_ReceivePropertiesToClient
void Client_ReceivePropertiesToClient( RemoteEntityWorld sender, ReceiveDataReader reader )
{
Size = reader.ReadVec2();
Position = reader.ReadVec3();
Segments = reader.ReadVec2i();
RenderQueueGroup = (RenderQueueGroupID)reader.ReadVariableUInt32();
ReflectionLevel = (ReflectionLevels)reader.ReadVariableUInt32();
PhysicsHeight = reader.ReadSingle();
DeepColor = reader.ReadColorValue();
ShallowColor = reader.ReadColorValue();
ReflectionColor = reader.ReadColorValue();
ReflectionTextureSize = (ReflectionTextureSizes)reader.ReadVariableUInt32();
FixedPipelineMap = reader.ReadString();
FixedPipelineMapTiling = reader.ReadSingle();
FixedPipelineColor = reader.ReadColorValue();
}