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


C# Packet.Add方法代码示例

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


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

示例1: AccountInfoRequestR

        /// <summary>
        /// Sends AccountInfoRequestR to client, with client's account's data.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="success"></param>
        public static void AccountInfoRequestR(LoginClient client, bool success)
        {
            var packet = new Packet(Op.AccountInfoRequestR, MabiId.Login);
            packet.PutByte(success);

            if (success)
                packet.Add(client.Account);

            client.Send(packet);
        }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例2: LoginR

		/// <summary>
		/// Sends positive response to login.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="account"></param>
		/// <param name="sessionKey"></param>
		/// <param name="serverList"></param>
		public static void LoginR(LoginClient client, Account account, long sessionKey, ICollection<ServerInfo> serverList)
		{
			var packet = new Packet(Op.LoginR, MabiId.Login);
			packet.PutByte((byte)LoginResult.Success);
			packet.PutString(account.Name);
			// [160XXX] Double account name
			{
				packet.PutString(account.Name);
			}
			packet.PutLong(sessionKey);
			packet.PutByte(0);

			// Servers
			// --------------------------------------------------------------
			packet.AddServerList(serverList, ServerInfoType.Client);

			// Account Info
			// --------------------------------------------------------------
			packet.Add(account);

			client.Send(packet);
		}
开发者ID:aura-project,项目名称:aura,代码行数:29,代码来源:Send.cs

示例3: LoginR

        /// <summary>
        /// Sends positive response to login.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="account"></param>
        /// <param name="sessionKey"></param>
        /// <param name="servers"></param>
        public static void LoginR(LoginClient client, Account account, long sessionKey, List<ServerInfo> servers)
        {
            var packet = new Packet(Op.LoginR, MabiId.Login);
            packet.PutByte((byte)LoginResult.Success);
            packet.PutString(account.Name);
            // [160XXX] Double account name
            {
                packet.PutString(account.Name);
            }
            packet.PutLong(sessionKey);
            packet.PutByte(0);

            // Servers
            // --------------------------------------------------------------
            packet.PutByte((byte)servers.Count);
            foreach (var server in servers)
                packet.Add(server);

            // Account Info
            // --------------------------------------------------------------
            packet.Add(account);

            client.Send(packet);
        }
开发者ID:pie3467,项目名称:aura,代码行数:31,代码来源:Send.cs

示例4: ChannelUpdate

        /// <summary>
        /// Sends server/channel status update to all connected clients,
        /// incl channels.
        /// </summary>
        public static void ChannelUpdate()
        {
            var packet = new Packet(Op.ChannelStatus, MabiId.Login);
            packet.PutByte((byte)LoginServer.Instance.ServerList.List.Count);
            foreach (var server in LoginServer.Instance.ServerList.List)
                packet.Add(server);

            LoginServer.Instance.Broadcast(packet);
        }
开发者ID:pie3467,项目名称:aura,代码行数:13,代码来源:Send.cs


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