本文整理汇总了C#中ReceiveDataReader.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDataReader.ReadBoolean方法的具体用法?C# ReceiveDataReader.ReadBoolean怎么用?C# ReceiveDataReader.ReadBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReceiveDataReader
的用法示例。
在下文中一共展示了ReceiveDataReader.ReadBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Client_ReceiveMoveFinish
void Client_ReceiveMoveFinish( RemoteEntityWorld sender, ReceiveDataReader reader )
{
bool putToDestinationPlace = reader.ReadBoolean();
bool completePuzzle = reader.ReadBoolean();
if( !reader.Complete() )
return;
client_movingByUser = null;
//play sounds
if( putToDestinationPlace )
ClientOrSingle_SoundPlay( "Maps\\JigsawPuzzleGame\\PutToDestinationPlace.ogg" );
if( completePuzzle )
ClientOrSingle_SoundPlay( "Maps\\JigsawPuzzleGame\\CompletePuzzle.ogg" );
}
示例2: Client_ReceiveCreateBulletEvent
void Client_ReceiveCreateBulletEvent( RemoteEntityWorld sender, ReceiveDataReader reader )
{
bool alternativeModeFlag = reader.ReadBoolean();
if( !reader.Complete() )
return;
Mode mode = alternativeModeFlag ? alternativeMode : normalMode;
SoundPlay3D( mode.typeMode.SoundFire, .5f, true );
mode.typeMode.FireObjects.CreateObjectsOfOneRandomSelectedGroup( this );
}
示例3: 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;
}
示例4: ReceiveMessage_WorldDestroyToClient
private bool ReceiveMessage_WorldDestroyToClient(NetworkNode.ConnectedNode sender,
MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
{
bool newMapWillBeLoaded = reader.ReadBoolean();
if (!reader.Complete())
return false;
if (WorldDestroy != null)
WorldDestroy(this, newMapWillBeLoaded);
if (EntitySystemWorld.Instance != null && networkingInterface != null)
{
if (serverRemoteEntityWorld != null)
networkingInterface.DisconnectRemoteEntityWorld(serverRemoteEntityWorld);
}
serverRemoteEntityWorld = null;
return true;
}
示例5: 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 );
}
示例6: Client_ReceiveSoundPlayKick
void Client_ReceiveSoundPlayKick( RemoteEntityWorld sender, ReceiveDataReader reader )
{
bool alternative = reader.ReadBoolean();
if( !reader.Complete() )
return;
MeleeWeaponType.MeleeWeaponMode typeMode = alternative ?
Type.AlternativeMode : Type.NormalMode;
SoundPlay3D( typeMode.SoundKick, .5f, false );
}
示例7: Client_ReceiveAddUser
void Client_ReceiveAddUser( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint identifier = reader.ReadVariableUInt32();
string name = reader.ReadString();
bool bot = reader.ReadBoolean();
uint userIdentifier = reader.ReadVariableUInt32();
if( !reader.Complete() )
return;
//check for already exists
{
Client_Player playerForCheck = Client_GetPlayer( identifier );
if( playerForCheck != null )
{
Log.Fatal( "PlayerManager: Client_ReceiveAddUserToClient: Player " +
"with identifier \"{0}\" is already exists.", identifier );
}
}
UserManagementClientNetworkService.UserInfo user = null;
if( userIdentifier != 0 )
user = GameNetworkClient.Instance.UserManagementService.GetUser( userIdentifier );
Client_Player player = new Client_Player( identifier, name, bot, user );
client_players.Add( player );
}
示例8: Client_ReceiveBodiesPositions
void Client_ReceiveBodiesPositions( RemoteEntityWorld sender, ReceiveDataReader reader )
{
//clear snapshots cache if entity is not created
if( !IsPostCreated )
client_receivePositionsSnapshots.Clear();
//check for invalid snapshot cache
if( client_receivePositionsSnapshots.Count != 0 )
{
Client_ReceivePositionsSnapshot lastSnapshot = client_receivePositionsSnapshots[
client_receivePositionsSnapshots.Count - 1 ];
if( lastSnapshot.bodies == null )
{
//remove snapshot cache
client_receivePositionsSnapshots.Clear();
}
}
int count = (int)reader.ReadVariableUInt32();
Client_ReceivePositionsSnapshot snapshot = new Client_ReceivePositionsSnapshot();
snapshot.networkTickNumber = EntitySystemWorld.Instance.NetworkTickCounter;
snapshot.bodies = new Client_ReceivePositionsSnapshot.BodyItem[ count ];
//receive bodies positions and rotations
for( int n = 0; n < count; n++ )
{
Client_ReceivePositionsSnapshot.BodyItem bodyItem = new
Client_ReceivePositionsSnapshot.BodyItem();
//read position
if( reader.ReadBoolean() )
{
bodyItem.position = reader.ReadVec3();
}
else
{
//get position from previous snapshot
if( client_receivePositionsSnapshots.Count != 0 )
{
bodyItem.position = client_receivePositionsSnapshots[
client_receivePositionsSnapshots.Count - 1 ].bodies[ n ].position;
}
}
//read rotation
if( reader.ReadBoolean() )
{
bodyItem.rotation = reader.ReadQuat( 16 );
}
else
{
//get rotation from previous snapshot
if( client_receivePositionsSnapshots.Count != 0 )
{
bodyItem.rotation = client_receivePositionsSnapshots[
client_receivePositionsSnapshots.Count - 1 ].bodies[ n ].rotation;
}
}
snapshot.bodies[ n ] = bodyItem;
}
if( !reader.Complete() )
return;
client_receivePositionsSnapshots.Add( snapshot );
if( IsPostCreated )
Client_UpdatePositionsBySnapshots( false );
}
示例9: Client_ReceivePropertiesToClient
void Client_ReceivePropertiesToClient( RemoteEntityWorld sender, ReceiveDataReader reader )
{
Size = reader.ReadVec2();
Position = reader.ReadVec3();
Segments = reader.ReadVec2I();
CustomMesh = reader.ReadString();
RenderQueueGroup = (RenderQueueGroups)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();
UseHDRTexture = reader.ReadBoolean();
AllowFog = reader.ReadBoolean();
}
示例10: Client_ReceiveIntellect
void Client_ReceiveIntellect( RemoteEntityWorld sender, ReceiveDataReader reader )
{
uint networkUIN = reader.ReadVariableUInt32();
bool shouldDeleteAfterDetach = reader.ReadBoolean();
if( !reader.Complete() )
return;
Intellect i = null;
if( networkUIN != 0 )
i = (Intellect)Entities.Instance.GetByNetworkUIN( networkUIN );
SetIntellect( i, shouldDeleteAfterDetach );
}
示例11: Client_ReceiveUpdateMasc
private void Client_ReceiveUpdateMasc(RemoteEntityWorld sender, ReceiveDataReader reader)
{
bool value = reader.ReadBoolean();
if (!reader.Complete())
return;
mascOn = value;
if (mascOn)
{
mascSpeed = Type.MaxForwardSpeed * 2;
mascForce = Type.DriveForwardForce * 2;
}
else
{
mascSpeed = 0;
mascForce = 0;
}
}
示例12: Client_ReceiveUpdateMechBoster
private void Client_ReceiveUpdateMechBoster(RemoteEntityWorld sender, ReceiveDataReader reader)
{
bool value = reader.ReadBoolean();
if (!reader.Complete())
return;
boosted = value;
}
示例13: 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);
}
示例14: Client_ReceiveFireEvent
void Client_ReceiveFireEvent( RemoteEntityWorld sender, ReceiveDataReader reader )
{
bool alternative = reader.ReadBoolean();
if( !reader.Complete() )
return;
GunType.GunMode typeMode = alternative ? Type.AlternativeMode : Type.NormalMode;
OnFire( typeMode );
}
示例15: Client_ReceiveAlternativeMode
private void Client_ReceiveAlternativeMode(RemoteEntityWorld sender, ReceiveDataReader reader)
{
bool value = reader.ReadBoolean();
if (!reader.Complete())
return;
AlternativeMode = value;
}