本文整理汇总了C#中ClientMsg.Write方法的典型用法代码示例。如果您正苦于以下问题:C# ClientMsg.Write方法的具体用法?C# ClientMsg.Write怎么用?C# ClientMsg.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClientMsg
的用法示例。
在下文中一共展示了ClientMsg.Write方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LeaveChat
/// <summary>
/// Attempts to leave a chat room.
/// </summary>
/// <param name="steamId">The SteamID of the chat room.</param>
public void LeaveChat( SteamID steamId )
{
SteamID chatId = steamId.ConvertToUInt64(); // copy the steamid so we don't modify it
var leaveChat = new ClientMsg<MsgClientChatMemberInfo>();
if ( chatId.IsClanAccount )
{
// this steamid is incorrect, so we'll fix it up
chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
chatId.AccountType = EAccountType.Chat;
}
leaveChat.Body.SteamIdChat = chatId;
leaveChat.Body.Type = EChatInfoType.StateChange;
leaveChat.Write( Client.SteamID.ConvertToUInt64() ); // ChatterActedOn
leaveChat.Write( ( uint )EChatMemberStateChange.Left ); // StateChange
leaveChat.Write( Client.SteamID.ConvertToUInt64() ); // ChatterActedBy
Client.Send( leaveChat );
}