本文整理汇总了C#中MabiPacket.Add方法的典型用法代码示例。如果您正苦于以下问题:C# MabiPacket.Add方法的具体用法?C# MabiPacket.Add怎么用?C# MabiPacket.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MabiPacket
的用法示例。
在下文中一共展示了MabiPacket.Add方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMailsResponse
public static void GetMailsResponse(WorldClient client, IEnumerable<MabiMail> mails)
{
var p = new MabiPacket(Op.GetMailsR, client.Character.Id);
foreach (var mail in mails)
p.Add(mail);
p.PutLong(0);
client.Send(p);
}
示例2: SendMailResponse
public static void SendMailResponse(WorldClient client, MabiMail mail)
{
var packet = new MabiPacket(Op.SendMailR, client.Character.Id);
if (mail != null)
{
packet.PutByte(true);
packet.Add(mail);
}
else
{
packet.PutByte(false);
}
client.Send(packet);
}
示例3: LoginResponse
/// <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 LoginResponse(LoginClient client, Account account, ulong sessionKey, IEnumerable<MabiServer> servers)
{
var packet = new MabiPacket(Op.LoginR, Id.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: AccountInfoRequestResponse
/// <summary>
/// Sends account information. Response will be negative if account is null.
/// </summary>
/// <param name="client"></param>
public static void AccountInfoRequestResponse(LoginClient client, Account account)
{
var packet = new MabiPacket(Op.AccountInfoRequestR, Id.Login);
if (account != null)
{
packet.PutByte(true);
packet.Add(account);
}
else
{
packet.PutByte(false);
}
client.Send(packet);
}
示例5: ChannelUpdate
/// <summary>
/// Sends server/channel status update to all connected clients,
/// incl channels.
/// </summary>
public static void ChannelUpdate()
{
var packet = new MabiPacket(Op.ChannelStatus, Id.Login);
packet.PutByte((byte)LoginServer.Instance.ServerList.Count);
foreach (var server in LoginServer.Instance.ServerList.Values)
packet.Add(server);
LoginServer.Instance.Broadcast(packet);
}