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


C# ReceiveDataReader.ReadString方法代码示例

本文整理汇总了C#中ReceiveDataReader.ReadString方法的典型用法代码示例。如果您正苦于以下问题:C# ReceiveDataReader.ReadString方法的具体用法?C# ReceiveDataReader.ReadString怎么用?C# ReceiveDataReader.ReadString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReceiveDataReader的用法示例。


在下文中一共展示了ReceiveDataReader.ReadString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReceiveMessage_TransferMessageToServer

        private bool ReceiveMessage_TransferMessageToServer(NetworkNode.ConnectedNode sender,
            MessageType messageType, ReceiveDataReader reader, ref string error)
        {
            string message = reader.ReadString();
            string data = reader.ReadString();
            if (!reader.Complete())
                return false;

            if (ReceiveMessage != null)
                ReceiveMessage(this, sender, message, data);

            return true;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:13,代码来源:CustomMessagesNetworkService.cs

示例2: ReceiveMessage_TransferMessageToClient

        bool ReceiveMessage_TransferMessageToClient( NetworkNode.ConnectedNode sender,
            MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
        {
            string message = reader.ReadString();
            string data = reader.ReadString();
            if( !reader.Complete() )
                return false;

            if( ReceiveMessage != null )
                ReceiveMessage( this, message, data );

            return true;
        }
开发者ID:DarrenHassan,项目名称:GDM4242-GroupD,代码行数:13,代码来源:CustomMessagesNetworkService.cs

示例3: 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

示例4: 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

示例5: Client_ReceiveFaction

        void Client_ReceiveFaction(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            string s = reader.ReadString();
            if (!reader.Complete())
                return;

            text = s;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:8,代码来源:AKSpawnPointold.cs

示例6: ReceiveMessage_WorldCreateBeginToClient

        bool ReceiveMessage_WorldCreateBeginToClient( NetworkNode.ConnectedNode sender,
			MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage )
        {
            string worldTypeName = reader.ReadString();
            string mapVirtualFileName = reader.ReadString();
            if( !reader.Complete() )
                return false;

            bool remoteWorldAlreadyExists = EntitySystemWorld.Instance.RemoteEntityWorlds.Contains(
                serverRemoteEntityWorld );

            if( !remoteWorldAlreadyExists )
            {
                serverRemoteEntityWorld = new RemoteEntityWorld( "Server remote entity world" );
                networkingInterface.ConnectRemoteEntityWorld( serverRemoteEntityWorld );
            }

            WorldType worldType = EntityTypes.Instance.GetByName( worldTypeName ) as WorldType;
            if( worldType == null )
            {
                Log.Fatal( "EntitySystemClientNetworkService: " +
                    "ReceiveMessage_WorldCreateBeginToClient: World type \"{0}\" is not exists.",
                    worldTypeName );
            }

            if( WorldCreateBegin != null )
                WorldCreateBegin( this, worldType, mapVirtualFileName );

            return true;
        }
开发者ID:CITS4242B2010,项目名称:project2010,代码行数:30,代码来源:EntitySystemNetworkService.cs

示例7: ReceiveMessage_WorldCreateBeginToClient

        private bool ReceiveMessage_WorldCreateBeginToClient(NetworkNode.ConnectedNode sender,
            MessageType messageType, ReceiveDataReader reader, ref string additionalErrorMessage)
        {
            string worldTypeName = reader.ReadString();
            string mapVirtualFileName = reader.ReadString();
            int worldCheckIdentifier = reader.ReadInt32();
            if (!reader.Complete())
                return false;

            //send world identifier back to server
            {
                MessageType messageType2 = GetMessageType("worldIdentifierToServer");
                SendDataWriter writer = BeginMessage(messageType2);
                writer.Write(worldCheckIdentifier);
                EndMessage();
            }

            bool remoteWorldAlreadyExists = EntitySystemWorld.Instance.RemoteEntityWorlds.Contains(
                serverRemoteEntityWorld);

            if (!remoteWorldAlreadyExists)
            {
                serverRemoteEntityWorld = new RemoteEntityWorld("Server remote entity world");
                networkingInterface.ConnectRemoteEntityWorld(serverRemoteEntityWorld);
            }

            WorldType worldType = EntityTypes.Instance.GetByName(worldTypeName) as WorldType;
            if (worldType == null)
            {
                Log.Fatal("EntitySystemClientNetworkService: " +
                    "ReceiveMessage_WorldCreateBeginToClient: World type \"{0}\" is not exists.",
                    worldTypeName);
            }

            if (WorldCreateBegin != null)
                WorldCreateBegin(this, worldType, mapVirtualFileName);

            return true;
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:39,代码来源:EntitySystemNetworkService.cs

示例8: Client_ReceiveSupportedUnits

        void Client_ReceiveSupportedUnits(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            string supportedTypes = reader.ReadString();
            if (!reader.Complete())
                return;

            char[] supportedUnits = supportedTypes.ToCharArray();

            foreach (char c in supportedUnits)
            {
                int i = int.Parse(c.ToString());
                Hangar_Vehicle_Type hvt = (Hangar_Vehicle_Type)i;
                if (!VehicleType.Contains(hvt))
                    VehicleType.Add(hvt);
            }
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:16,代码来源:Hangar.cs

示例9: Server_ReceiveSpawnRequest

        void Server_ReceiveSpawnRequest(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            string unitTypeName = reader.ReadString();
            string variantText = reader.ReadString();

            if (!reader.Complete())
                return;

            UnitType ut = (UnitType)EntityTypes.Instance.GetByName(unitTypeName);

            string[] broken = variantText.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries);

            int[] finalData = new int[broken.Length];

            for (int i = 0; i < broken.Length; i++)
                finalData[i] = int.Parse(broken[i]);

            SpawnNewUnit(ut, finalData);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:19,代码来源:Hangar.cs

示例10: 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

示例11: 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

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

示例13: Client_ReceiveHitCall

        private void Client_ReceiveHitCall(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            Vec3 hitPosition = reader.ReadVec3();
            string hitShapeBodyName = reader.ReadString();
            string hitShapeName = reader.ReadString();
            Vec3 hitNormal = reader.ReadVec3();
            MapObject hitMapObject = Entities.Instance.GetByNetworkUIN(reader.ReadVariableUInt32()) as MapObject;
            if (!reader.Complete())
                return;

            Position = hitPosition;
            Shape hitShape = null;
            if (PhysicsModel != null)
            {
                Body body = PhysicsModel.GetBody(hitShapeBodyName);
                if (body != null)
                    hitShape = body.GetShape(hitShapeName);
            }
            OnHit(hitShape, hitNormal, hitMapObject);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:20,代码来源:Bullet.cs

示例14: 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

示例15: Client_ReceiveFaction

        private void Client_ReceiveFaction(RemoteEntityWorld sender, ReceiveDataReader reader)
        {
            string s = reader.ReadString();
            if (!reader.Complete())
                return;

            faction = (FactionType)EntityTypes.Instance.GetByName(s);
        }
开发者ID:AKNightHawk,项目名称:AssaultKnights2,代码行数:8,代码来源:AKMapObject.cs


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