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


C# ServerMessage.AppendUInt32方法代码示例

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


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

示例1: Compose

        public static ServerMessage Compose(ModerationTicket Ticket)
        {
            string DisplayRoomName = string.Empty;

            if (Ticket.RoomId > 0)
            {
                RoomInfo Info = RoomInfoLoader.GetRoomInfo(Ticket.RoomId);
                DisplayRoomName = Info == null ? "(Unknown room " + Ticket.RoomId + ")" : Info.Name;
            }

            ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_TICKET);
            Message.AppendUInt32(Ticket.Id);
            Message.AppendUInt32(Ticket.TabId);
            Message.AppendUInt32(11); // ?? unknown
            Message.AppendUInt32(Ticket.CategoryId);
            Message.AppendUInt32(11); // ?? unknown
            Message.AppendUInt32(Ticket.Score);
            Message.AppendUInt32(Ticket.ReporteeUserId);
            Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReporteeUserId));
            Message.AppendUInt32(Ticket.ReportedUserId);
            Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ReportedUserId));
            Message.AppendUInt32(Ticket.ModeratorUserId);
            Message.AppendStringWithBreak(CharacterResolverCache.GetNameFromUid(Ticket.ModeratorUserId));
            Message.AppendStringWithBreak(Ticket.Message);
            Message.AppendUInt32(Ticket.RoomId);
            Message.AppendStringWithBreak(DisplayRoomName);
            return Message;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:28,代码来源:ModerationTicketComposer.cs

示例2: Compose

 public static ServerMessage Compose(uint Code1, uint Code2)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_ERROR_EVENT);
     Message.AppendUInt32(Code1);
     Message.AppendUInt32(Code2);
     return Message;
 }
开发者ID:habb0,项目名称:Snowlight,代码行数:7,代码来源:MessengerErrorEvent.cs

示例3: Compose

 public static ServerMessage Compose(uint RoomId, uint UserId)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_RIGHTS_REMOVED_CONFIRMATION);
     Message.AppendUInt32(RoomId);
     Message.AppendUInt32(UserId);
     return Message;
 }
开发者ID:habb0,项目名称:Snowlight,代码行数:7,代码来源:RoomRightsRemovedConfirmationComposer.cs

示例4: Compose

        public static ServerMessage Compose(Vector3 Source, Vector3 Target, uint RollerId, uint ActorId, uint ItemId)
        {
            bool ItemMode = ItemId > 0;

            ServerMessage Message = new ServerMessage(OpcodesOut.ROLLER_EVENT);
            Message.AppendInt32(Source.X);
            Message.AppendInt32(Source.Y);
            Message.AppendInt32(Target.X);
            Message.AppendInt32(Target.Y);
            Message.AppendBoolean(ItemMode);

            if (ItemMode)
            {
                Message.AppendUInt32(ItemId);
            }
            else
            {
                Message.AppendUInt32(RollerId);
                Message.AppendInt32(2);
                Message.AppendUInt32(ActorId);
            }

            Message.AppendRawDouble(Source.Z);
            Message.AppendRawDouble(Target.Z);

            if (ItemMode)
            {
                Message.AppendUInt32(RollerId);
            }

            return Message;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:32,代码来源:RollerEventComposer.cs

示例5: Compose

 public static ServerMessage Compose(uint ErrorId, uint ConversationId)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_IM_ERROR);
     Message.AppendUInt32(ErrorId);
     Message.AppendUInt32(ConversationId);
     return Message;
 }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:7,代码来源:MessengerImErrorComposer.cs

示例6: Compose

        public static ServerMessage Compose(uint UserId, Dictionary<ModerationRoomVisit, ReadOnlyCollection<ModerationChatlogEntry>> Entries)
        {
            string CharacterNameString = CharacterResolverCache.GetNameFromUid(UserId);

            ServerMessage Message = new ServerMessage(OpcodesOut.MODERATION_CHATLOGS_USER);
            Message.AppendUInt32(UserId);
            Message.AppendStringWithBreak(CharacterNameString);
            Message.AppendInt32(Entries.Count);

            foreach (KeyValuePair<ModerationRoomVisit, ReadOnlyCollection<ModerationChatlogEntry>> EntryData in Entries)
            {
                RoomInfo Info = RoomInfoLoader.GetRoomInfo(EntryData.Key.RoomId);

                Message.AppendBoolean(Info != null && Info.Type == RoomType.Public);
                Message.AppendUInt32(Info != null ? Info.Id : 0);
                Message.AppendStringWithBreak(Info != null ? Info.Name : "(Unknown room)");
                Message.AppendInt32(EntryData.Value.Count);

                foreach (ModerationChatlogEntry Entry in EntryData.Value)
                {
                    DateTime Time = UnixTimestamp.GetDateTimeFromUnixTimestamp(Entry.Timestamp);

                    Message.AppendInt32(Time.Hour);
                    Message.AppendInt32(Time.Minute);
                    Message.AppendUInt32(Entry.UserId);
                    Message.AppendStringWithBreak(Entry.UserId == UserId ? CharacterNameString :
                        CharacterResolverCache.GetNameFromUid(Entry.UserId));
                    Message.AppendStringWithBreak(Entry.Message);
                }
            }

            return Message;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:33,代码来源:ModerationUserChatlogsComposer.cs

示例7: Compose

        public static ServerMessage Compose(List<CharacterInfo> Friends, List<CharacterInfo> NonFriends)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_SEARCH_RESULT);
            Message.AppendInt32(Friends.Count);

            foreach (CharacterInfo Info in Friends)
            {
                Session FriendSession = SessionManager.GetSessionByCharacterId(Info.Id);

                Message.AppendUInt32(Info.Id);
                Message.AppendStringWithBreak(Info.Username);
                Message.AppendStringWithBreak(Info.Motto);
                Message.AppendBoolean(Info.HasLinkedSession);
                Message.AppendBoolean(FriendSession != null ? FriendSession.InRoom : false);
                Message.AppendStringWithBreak(string.Empty);
                Message.AppendBoolean(true);
                Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Figure : string.Empty);

                if (Info.HasLinkedSession)
                {
                    Message.AppendStringWithBreak(string.Empty);
                }
                else
                {
                    DateTime LastOnline = UnixTimestamp.GetDateTimeFromUnixTimestamp(Info.TimestampLastOnline);
                    Message.AppendStringWithBreak(LastOnline.ToShortDateString() + " " + LastOnline.ToShortTimeString());
                }

                Message.AppendStringWithBreak(string.Empty);
            }

            Message.AppendInt32(NonFriends.Count);

            foreach (CharacterInfo Info in NonFriends)
            {
                Message.AppendUInt32(Info.Id);
                Message.AppendStringWithBreak(Info.Username);
                Message.AppendStringWithBreak(Info.Motto);
                Message.AppendBoolean(Info.HasLinkedSession);
                Message.AppendBoolean(false); // TODO: InRoom (really needed here??)
                Message.AppendStringWithBreak(string.Empty);
                Message.AppendBoolean(false);
                Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Figure : string.Empty);

                if (Info.HasLinkedSession)
                {
                    Message.AppendStringWithBreak(string.Empty);
                }
                else
                {
                    DateTime LastOnline = UnixTimestamp.GetDateTimeFromUnixTimestamp(Info.TimestampLastOnline);
                    Message.AppendStringWithBreak(LastOnline.ToShortDateString() + " " + LastOnline.ToShortTimeString());
                }

                Message.AppendStringWithBreak(string.Empty);
            }

            return Message;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:59,代码来源:MessengerSearchResultsComposer.cs

示例8: Compose

 public static ServerMessage Compose(uint RoomId, uint UserId, string Name)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_RIGHTS_GIVEN_CONFIRMATION);
     Message.AppendUInt32(RoomId);
     Message.AppendUInt32(UserId);
     Message.AppendStringWithBreak(Name);
     return Message;
 }
开发者ID:habb0,项目名称:Snowlight,代码行数:8,代码来源:RoomRightsGivenConfirmationComposer.cs

示例9: Compose

 public static ServerMessage Compose(uint UserOne, bool UserOneCanTrade, uint UserTwo, bool UserTwoCanTrade)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_TRADE_INITIATED);
     Message.AppendUInt32(UserOne);
     Message.AppendBoolean(UserOneCanTrade);
     Message.AppendUInt32(UserTwo);
     Message.AppendBoolean(UserTwoCanTrade);
     return Message;
 }
开发者ID:habb0,项目名称:Snowlight,代码行数:9,代码来源:TradeInitiatedComposer.cs

示例10: SerializeInventoryItem

        public static void SerializeInventoryItem(ServerMessage Message, Item Item)
        {
            int TypeNumber = 1;
            uint SecondaryId = 0;

            switch (Item.Definition.Behavior)
            {
                default:
                case ItemBehavior.StaticItem:

                    TypeNumber = 1;
                    break;

                case ItemBehavior.Wallpaper:

                    TypeNumber = 2;
                    break;

                case ItemBehavior.Floor:

                    TypeNumber = 3;
                    break;

                case ItemBehavior.Landscape:

                    TypeNumber = 4;
                    break;

                case ItemBehavior.MusicDisk:

                    TypeNumber = 8;
                    uint.TryParse(Item.DisplayFlags, out SecondaryId);
                    break;
            }

            Message.AppendUInt32(Item.Id); // Item ID in the negatives (0 - id)
            Message.AppendStringWithBreak(Item.Definition.TypeLetter.ToUpper()); // Type (I, S, E, etc)
            Message.AppendUInt32(Item.Id); // Item ID in the positives (0 + id)
            Message.AppendUInt32(Item.Definition.SpriteId); // Sprite
            Message.AppendInt32(TypeNumber);
            Message.AppendStringWithBreak(Item.DisplayFlags); // Unknown
            Message.AppendBoolean(Item.CanRecycle);
            Message.AppendBoolean(Item.CanTrade);
            Message.AppendBoolean(Item.Definition.AllowInventoryStack);
            Message.AppendBoolean(Item.CanSell);
            Message.AppendInt32(-1);

            if (Item.Definition.Type == ItemType.FloorItem)
            {
                Message.AppendStringWithBreak(string.Empty);
                Message.AppendUInt32(SecondaryId);
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:53,代码来源:InventoryComposer.cs

示例11: Compose

 public static ServerMessage Compose(uint DisplayId, Pet Pet)
 {
     ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_PET_UPDATE);
     Message.AppendInt32(9);
     Message.AppendUInt32(DisplayId);
     Message.AppendUInt32(DisplayId);
     Message.AppendStringWithBreak(Pet.Name);
     Message.AppendInt32(Pet.Type);
     Message.AppendInt32(Pet.Race);
     Message.AppendStringWithBreak(Pet.ColorCode);
     return Message;
 }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:12,代码来源:RoomPetUpdateComposer.cs

示例12: Compose

        public static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.JUKEBOX_PLAYLIST);
            Message.AppendInt32(PlaylistCapacity);
            Message.AppendInt32(Playlist.Count);

            foreach (SongInstance Song in Playlist)
            {
                Message.AppendUInt32(Song.DiskItem.Id);
                Message.AppendUInt32(Song.SongData.Id);
            }

            return Message;
        }
开发者ID:habb0,项目名称:Snowlight,代码行数:14,代码来源:JukeboxPlaylistComposer.cs

示例13: Compose

        public static ServerMessage Compose(uint CharacterId, SortedDictionary<int, Badge> Badges)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_BADGES);
            Message.AppendUInt32(CharacterId);
            Message.AppendInt32(Badges.Count);

            foreach (Badge Badge in Badges.Values)
            {
                Message.AppendUInt32(Badge.Id);
                Message.AppendStringWithBreak(Badge.Code);
            }

            return Message;
        }
开发者ID:habb0,项目名称:Snowlight,代码行数:14,代码来源:RoomUserBadgesComposer.cs

示例14: SerializeOfficialItem

        private static void SerializeOfficialItem(NavigatorOfficialItem Item, ServerMessage Message)
        {
            RoomInstance Instance = null;
            RoomInfo Info = null;

            if (!Item.IsCategory)
            {
                Instance = Item.TryGetRoomInstance();
                Info = Item.GetRoomInfo();
            }

            int Type = 3;

            if (Item.IsCategory)
            {
                Type = 4;
            }
            else if (Info != null && Info.Type == RoomType.Flat)
            {
                Type = 2;
            }

            Message.AppendUInt32(Item.Id);
            Message.AppendStringWithBreak(Item.Name);
            Message.AppendStringWithBreak(Item.Descr);
            Message.AppendInt32((int)Item.DisplayType);
            Message.AppendStringWithBreak(Item.BannerLabel);
            Message.AppendStringWithBreak(Item.ImageType == NavigatorOfficialItemImageType.External ? Item.Image : string.Empty);
            Message.AppendUInt32(Item.ParentId);
            Message.AppendInt32(Info != null ? Info.CurrentUsers : 0);
            Message.AppendInt32(Type);

            if (Item.IsCategory)
            {
                Message.AppendBoolean(Item.CategoryAutoExpand); // Category auto expand
            }
            else if (Info != null && Info.Type == RoomType.Public)
            {
                Message.AppendStringWithBreak(Item.ImageType == NavigatorOfficialItemImageType.Internal ? Item.Image : string.Empty);
                Message.AppendInt32(0); // Appears to be nothing but junk!
                Message.AppendInt32(0); // Something to do with room parts (e.g. lido part 0 & 1) default 0
                Message.AppendStringWithBreak(Info.SWFs);
                Message.AppendInt32(Info.MaxUsers);
                Message.AppendUInt32(Info.Id);
            }
            else if (Info != null && Info.Type == RoomType.Flat)
            {
                NavigatorRoomListComposer.SerializeRoom(Message, Info);
            }
        }
开发者ID:habb0,项目名称:Snowlight,代码行数:50,代码来源:NavigatorOfficialRoomsComposer.cs

示例15: Compose

        public static ServerMessage Compose(uint CategoryId, List<HelpTopic> Topics)
        {
            ServerMessage Message = new ServerMessage(OpcodesOut.HELP_TOPIC_LIST);
            Message.AppendUInt32(CategoryId);
            Message.AppendStringWithBreak(string.Empty);
            Message.AppendInt32(Topics.Count);

            foreach (HelpTopic Topic in Topics)
            {
                Message.AppendUInt32(Topic.Id);
                Message.AppendStringWithBreak(Topic.Title);
            }

            return Message;
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:15,代码来源:HelpTopicListComposer.cs


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