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


C# NetIncomingMessage.ReadString方法代码示例

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


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

示例1: Read

 internal override void Read(NetIncomingMessage Message)
 {
     Name = Message.ReadString();
     if (!Guid.TryParse(Message.ReadString(), out CurrentConfigurationID)) {
         throw new Exception("Unable to parse GUID for CurrentConfig in server info.");
     }
 }
开发者ID:CloneDeath,项目名称:FantasyScape,代码行数:7,代码来源:ServerInfo.cs

示例2: FromNetMsg

 public override void FromNetMsg(NetIncomingMessage netMsg)
 {
     // Here we assume that typeID was read before to determine which kind of message it was.
     m_senderName = netMsg.ReadString();
     m_group = netMsg.ReadString();
     m_message = netMsg.ReadString();
 }
开发者ID:SharpEdgeEntertainment,项目名称:FrozenFlameFramework,代码行数:7,代码来源:F3_ChatMessage_Group.cs

示例3: Read

 internal override void Read(NetIncomingMessage Message)
 {
     base.Read(Message);
     Language = (CodeLanguage)Enum.Parse(typeof(CodeLanguage), Message.ReadString());
     Location = (CodeLocation)Enum.Parse(typeof(CodeLocation), Message.ReadString());
     Source = Message.ReadString();
 }
开发者ID:CloneDeath,项目名称:FantasyScape,代码行数:7,代码来源:CodeFile.cs

示例4: ReadPayload

 /// <summary>
 /// Reads the transport into the contents of this type.
 /// </summary>
 public void ReadPayload(NetIncomingMessage message)
 {
     Identity = message.ReadString();
     NovaId = message.ReadString();
     PasswordHash = message.ReadString();
     PublicEndPoint = message.ReadIPEndpoint();
     PrivateEndPoint = message.ReadIPEndpoint();
 }
开发者ID:theslyone,项目名称:RemoteDesktop,代码行数:11,代码来源:Machine.cs

示例5: onclientrecieve

        public override void onclientrecieve(NetIncomingMessage message)
        {
            string id = message.ReadString();
            string text = message.ReadString();
            Console.WriteLine(text);

            base.onclientrecieve(message);
        }
开发者ID:law4x,项目名称:stonevox3d,代码行数:8,代码来源:Packet_Chat.cs

示例6: ConnectionMessage

 public ConnectionMessage(NetIncomingMessage msg)
 {
     string encryptedUsername = msg.ReadString();
     string encryptedPassword = msg.ReadString();
     byte[] xUsername = Xor(Encoding.UTF8.GetBytes(encryptedUsername), EncryptionKey);
     byte[] xPassword = Xor(Encoding.UTF8.GetBytes(encryptedPassword), EncryptionKey);
     Username = Encoding.UTF8.GetChars(xUsername).ToString();
     Password = Encoding.UTF8.GetChars(xPassword).ToString();
 }
开发者ID:Aryn,项目名称:Mobile-Fortress,代码行数:9,代码来源:ConnectionMessage.cs

示例7: Decode

        public void Decode(NetIncomingMessage im)
        {
            this.Username = im.ReadString();
            this.Password = im.ReadString();
            this.Color = ColorExtensions.ColorFromHSV(im.ReadInt16(), Client.IO.ColorSaturation / 255f, Client.IO.ColorValue / 255f);

            if (Username.Length > Settings.MaxNameLength) //Clamp name length
                Username = Username.Truncate(Settings.MaxNameLength);
        }
开发者ID:Express50,项目名称:Bricklayer,代码行数:9,代码来源:LoginMessage.cs

示例8: NotifySend

		public virtual S2C.Message.NotifySend NotifySend(NetIncomingMessage im)
		{
			Message.NotifySend data = new Message.NotifySend();
			data.from_id = im.ReadString();
			data.message = im.ReadString();
			if(OnNotifySend != null) OnNotifySend(im, data);

			return data;
		}
开发者ID:jeidee,项目名称:Lidgren.Network.Wrapper,代码行数:9,代码来源:S2C.Stub.cs

示例9: ReqSend

		public virtual C2S.Message.ReqSend ReqSend(NetIncomingMessage im)
		{
			Message.ReqSend data = new Message.ReqSend();
			data.to_id = im.ReadString();
			data.message = im.ReadString();
			if(OnReqSend != null) OnReqSend(im, data);

			return data;
		}
开发者ID:jeidee,项目名称:Lidgren.Network.Wrapper,代码行数:9,代码来源:C2S.Stub.cs

示例10: Read

            public static PlayerInformation Read(NetIncomingMessage packet)
            {
                Byte slot = packet.ReadByte();
                TeamType team = (TeamType)packet.ReadByte();
                String callsign = packet.ReadString();
                String tag = packet.ReadString();

                return new PlayerInformation(slot, callsign, tag, team);
            }
开发者ID:aotis,项目名称:AngryTanks,代码行数:9,代码来源:Messages.cs

示例11: onserverrecieve

        public override void onserverrecieve(NetIncomingMessage message)
        {
            var chat = PacketWriter.write<Packet_Chat>(NetEndpoint.SERVER);
            chat.outgoingmessage.Write(message.ReadString());
            chat.outgoingmessage.Write(message.ReadString());
            chat.send();

            base.onserverrecieve(message);
        }
开发者ID:law4x,项目名称:stonevox3d,代码行数:9,代码来源:Packet_Chat.cs

示例12: ResSend

		public virtual S2C.Message.ResSend ResSend(NetIncomingMessage im)
		{
			Message.ResSend data = new Message.ResSend();
			data.ret = im.ReadInt16();
			data.ret_message = im.ReadString();
			data.to_id = im.ReadString();
			if(OnResSend != null) OnResSend(im, data);

			return data;
		}
开发者ID:jeidee,项目名称:Lidgren.Network.Wrapper,代码行数:10,代码来源:S2C.Stub.cs

示例13: OnDataReceived

        public override void OnDataReceived(NetIncomingMessage incMsg)
        {
            NetDataType type = (NetDataType)incMsg.ReadByte();
            if (type == NetDataType.eDATA_REQUEST_LOGIN)
            {
                string accountName = incMsg.ReadString();
                string password = incMsg.ReadString();

                Login(accountName, password, incMsg.SenderConnection);
            }
        }
开发者ID:SharpEdgeEntertainment,项目名称:FrozenFlameFramework,代码行数:11,代码来源:F3_LoginNetwork.cs

示例14: IncomingChangeLevel

        protected void IncomingChangeLevel(NetIncomingMessage msg)
        {
            string levelName = msg.ReadString();
            string levelData = msg.ReadString();
            double delayTime = double.Parse(msg.ReadString());
            double recieveTime = msg.ReceiveTime / 1000;
            double actualDelayTime = delayTime - recieveTime;

            DownloadLevel(levelName, levelData);
            OnChangedLevel(levelName, actualDelayTime);
        }
开发者ID:Johanw123,项目名称:MonoPlatformerGame,代码行数:11,代码来源:GameplayNetComponent.cs

示例15: DataProcessing

 // TODO: Merge opcodes for move direction, something like that: Move(LookDirection)
 void DataProcessing(NetIncomingMessage message, ref Client client)
 {
     switch (message.ReadByte())
     {
         case (byte)MessageType.ClientMessage.NeedMap:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Need map ! Let's give it to him :)");
             ReceiveNeedMap(client);
             break;
         case (byte)MessageType.ClientMessage.MapSelection:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Has selected a map to play ! :)");
             ReceiveMapSelection(client, message.ReadString());
             break;
         case (byte)MessageType.ClientMessage.Credentials:
             ReceiveCredentials(client, message.ReadString(), message.ReadString());
             break;
         case (byte)MessageType.ClientMessage.Ready:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Ready message !");
             ReceiveReady(client, message.ReadBoolean());
             break;
         case (byte)MessageType.ClientMessage.WantToStartGame:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] WantToStartGame message !");
             ReceiveWantToStartGame();
             break;
         case (byte)MessageType.ClientMessage.HasMap:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] HasMap message !");
             ReceiveHasMap(client);
             break;
         case (byte)MessageType.ClientMessage.MoveDown:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move down !");
             ReceiveMovePlayer(client, LookDirection.Down);
             break;
         case (byte)MessageType.ClientMessage.MoveLeft:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move left !");
             ReceiveMovePlayer(client, LookDirection.Left);
             break;
         case (byte)MessageType.ClientMessage.MoveRight:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move right !");
             ReceiveMovePlayer(client, LookDirection.Right);
             break;
         case (byte)MessageType.ClientMessage.MoveUp:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to move up !");
             ReceiveMovePlayer(client, LookDirection.Up);
             break;
         case (byte)MessageType.ClientMessage.Standing:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to stay here !");
             ReceiveMovePlayer(client, LookDirection.Idle, message.ReadTime(client.ClientConnection, true));
             break;
         case (byte)MessageType.ClientMessage.PlaceBomb:
             Program.Log.Info("[RECEIVE][Client #" + client.ClientId + "] Want to place bomb !");
             ReceiveBombPlacing(client);
             break;
     }
 }
开发者ID:Noxalus,项目名称:Final-Bomber,代码行数:54,代码来源:DataProcessing.cs


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