当前位置: 首页>>代码示例>>C#>>正文


C# ReceiveDataReader.ReadVariableUInt32方法代码示例

本文整理汇总了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;
        }
开发者ID:whztt07,项目名称:SDK,代码行数:23,代码来源:ChatNetworkService.cs

示例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;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:36,代码来源:ChatNetworkService.cs

示例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 );
 }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:9,代码来源:WaterPlane.cs

示例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;
                }
            }
        }
开发者ID:whztt07,项目名称:SDK,代码行数:17,代码来源:PlayerManager.cs

示例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 );
        }
开发者ID:whztt07,项目名称:SDK,代码行数:13,代码来源:PlayerManager.cs

示例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;
                }
            }
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:21,代码来源:PlayerManager.cs

示例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();
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:19,代码来源:PlayerCharacter.cs

示例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;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:14,代码来源:UserManagementNetworkService.cs

示例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 );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:20,代码来源:PlayerIntellect.cs

示例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 );
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:9,代码来源:PlayerIntellect.cs

示例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;
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:11,代码来源:PlayerIntellect.cs

示例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);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:24,代码来源:Unit.cs

示例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 );
 }
开发者ID:whztt07,项目名称:SDK,代码行数:8,代码来源:Dynamic.cs

示例14: Client_ReceiveGameType

 void Client_ReceiveGameType( RemoteEntityWorld sender, ReceiveDataReader reader )
 {
     GameTypes value = (GameTypes)reader.ReadVariableUInt32();
     if( !reader.Complete() )
         return;
     gameType = value;
 }
开发者ID:whztt07,项目名称:SDK,代码行数:7,代码来源:GameMap.cs

示例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();
 }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:16,代码来源:WaterPlane.cs


注:本文中的ReceiveDataReader.ReadVariableUInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。