本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}