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


C# ClientMsg.WriteNullTermString方法代码示例

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


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

示例1: SendChatRoomMessage

        /// <summary>
        /// Sends a message to a chat room.
        /// </summary>
        /// <param name="steamIdChat">The SteamID of the chat room.</param>
        /// <param name="type">The message type.</param>
        /// <param name="message">The message.</param>
        public void SendChatRoomMessage( SteamID steamIdChat, EChatEntryType type, string message )
        {
            SteamID chatId = steamIdChat.ConvertToUInt64(); // copy the steamid so we don't modify it

            if ( chatId.IsClanAccount )
            {
                // this steamid is incorrect, so we'll fix it up
                chatId.AccountInstance = ( uint )SteamID.ChatInstanceFlags.Clan;
                chatId.AccountType = EAccountType.Chat;
            }

            var chatMsg = new ClientMsg<MsgClientChatMsg>();

            chatMsg.Body.ChatMsgType = type;
            chatMsg.Body.SteamIdChatRoom = chatId;
            chatMsg.Body.SteamIdChatter = Client.SteamID;

            chatMsg.WriteNullTermString( message, Encoding.UTF8 );

            this.Client.Send( chatMsg );
        }
开发者ID:katsalap,项目名称:SteamKit,代码行数:27,代码来源:SteamFriends.cs

示例2: SendGuestPass

        /// <summary>
        /// Send a guest pass or gift to a target user, defined by their account id or email
        /// </summary>
        /// <param name="giftId">64-bit GID of the gift</param>
        /// <param name="accountId">Account ID of the recipient</param>
        /// <param name="email">Optional email of the recipient</param>
        public void SendGuestPass( ulong giftId, uint accountId, string email = null )
        {
            var sendGift = new ClientMsg<MsgClientSendGuestPass>();

            sendGift.Body.GiftId = giftId;

            if ( string.IsNullOrEmpty( email ) )
            {
                sendGift.Body.GiftType = 1;
                sendGift.Body.AccountId = accountId;
                sendGift.WriteNullTermString( "" );
            }
            else
            {
                sendGift.Body.GiftType = 0;
                sendGift.Body.AccountId = 0;
                sendGift.WriteNullTermString( email );
            }

            this.Client.Send( sendGift );
        }
开发者ID:Nightgunner5,项目名称:steamkit-go,代码行数:27,代码来源:SteamApps.cs


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