• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Messages.ServerMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ServerMessage类属于Firewind.Messages命名空间,在下文中一共展示了ServerMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Serialize

 internal void Serialize(ref ServerMessage message)
 {
     foreach (ChatMessage chatMessage in listOfMessages)
     {
         chatMessage.Serialize(ref message);
     }
 }
开发者ID:TheNaked,项目名称:Firewind,代码行数:7,代码来源:ChatMessageManager.cs


示例2: Compose

        internal static ServerMessage Compose(List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(627); //627
            Message.AppendInt32(Achievements.Count);

            foreach (Achievement Achievement in Achievements)
            {
                string DisplayName = Achievement.GroupName;

                if (DisplayName.StartsWith("ACH_"))
                {
                    DisplayName = DisplayName.Substring(4);
                }

                Message.AppendString(DisplayName);
                Message.AppendInt32(Achievement.Levels.Count);

                foreach (AchievementLevel Level in Achievement.Levels.Values)
                {
                    Message.AppendInt32(Level.Level);
                    Message.AppendInt32(Level.Requirement);
                }
            }

            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:26,代码来源:AchievementDataListComposer.cs


示例3: Trade

        internal Trade(int UserOneId, int UserTwoId, UInt32 RoomId)
        {
            this.oneId = UserOneId;
            this.twoId = UserTwoId;

            this.Users = new TradeUser[2];
            this.Users[0] = new TradeUser(UserOneId, RoomId);
            this.Users[1] = new TradeUser(UserTwoId, RoomId);
            this.TradeStage = 1;
            this.RoomId = RoomId;

            foreach (TradeUser User in Users)
            {
                if (!User.GetRoomUser().Statuses.ContainsKey("trd"))
                {
                    User.GetRoomUser().AddStatus("trd", "");
                    User.GetRoomUser().UpdateNeeded = true;
                }
            }

            ServerMessage Message = new ServerMessage(Outgoing.TradeStart);
            Message.AppendInt32(UserOneId);
            Message.AppendInt32(1); // ready
            Message.AppendInt32(UserTwoId);
            Message.AppendInt32(1); // ready
            SendMessageToUsers(Message);
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:27,代码来源:Trade.cs


示例4: Serialize

 internal void Serialize(ref ServerMessage packet)
 {
     packet.AppendInt32(timeSpoken.Hour);
     packet.AppendInt32(timeSpoken.Minute);
     packet.AppendInt32(userID);
     packet.AppendString(username);
     packet.AppendString(message);
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:8,代码来源:ChatMessage.cs


示例5: Serialize

        internal void Serialize(ServerMessage Request)
        {
            // [email protected]22033860

            Request.AppendInt32(FromUser);
            Request.AppendString(mUsername);
            Habbo user = FirewindEnvironment.getHabboForName(mUsername);
            Request.AppendString((user != null) ? user.Look : "");
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:9,代码来源:MessengerRequest.cs


示例6: AppendToMessage

 public void AppendToMessage(ServerMessage message)
 {
     message.AppendInt32(Data.Count);
     foreach (KeyValuePair<string, string> pair in Data)
     {
         message.AppendString(pair.Key);
         message.AppendString(pair.Value);
     }
 }
开发者ID:TheNaked,项目名称:Firewind,代码行数:9,代码来源:MapStuffData.cs


示例7: SerializeUpdate

        internal static ServerMessage SerializeUpdate(MessengerBuddy friend)
        {
            ServerMessage reply = new ServerMessage(Outgoing.FriendUpdate);
            reply.AppendInt32(0); // category
            reply.AppendInt32(1); // number of updates
            reply.AppendInt32(0); // don't know

            friend.Serialize(reply);
            reply.AppendBoolean(false);

            return reply;
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:12,代码来源:HabboMessenger.cs


示例8: Compose

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

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

            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:14,代码来源:JukeboxDiscksComposer.cs


示例9: SerializeTo

        internal void SerializeTo(RoomData data, ServerMessage Message)
        {
            Message.AppendString(data.OwnerId + "");
            Message.AppendString(data.Owner);
            Message.AppendString(RoomId + "");
            Message.AppendInt32(Category);
            Message.AppendString(Name);
            Message.AppendString(Description);
            Message.AppendString(StartTime);
            Message.AppendInt32(Tags.Count);

            foreach (string Tag in Tags.ToArray())
            {
                Message.AppendString(Tag);
            }
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:16,代码来源:RoomEvent.cs


示例10: Searialize

        internal void Searialize(ServerMessage reply)
        {
            reply.AppendInt32(userID);
            reply.AppendString(username);
            reply.AppendString(motto);

            bool Online = (FirewindEnvironment.GetGame().GetClientManager().GetClientByUserID(userID) != null);

            reply.AppendBoolean(Online);

            reply.AppendBoolean(false);

            reply.AppendString(string.Empty);
            reply.AppendInt32(0);
            reply.AppendString(look);
            reply.AppendString(last_online);
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:17,代码来源:SearchResult.cs


示例11: Serialize

        internal ServerMessage Serialize(GameClient Session)
        {
            ServerMessage Message = new ServerMessage(Outgoing.RoomEvent);
            Message.AppendString(Session.GetHabbo().Id + "");
            Message.AppendString(Session.GetHabbo().Username);
            Message.AppendString(RoomId + "");
            Message.AppendInt32(Category);
            Message.AppendString(Name);
            Message.AppendString(Description);
            Message.AppendString(StartTime);
            Message.AppendInt32(Tags.Count);

            foreach (string Tag in Tags.ToArray())
            {
                Message.AppendString(Tag);
            }
            return Message;
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:18,代码来源:RoomEvent.cs


示例12: Compose

 internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
 {
     ServerMessage Message = new ServerMessage(Outgoing.UnlockAchievement);
     Message.AppendUInt(Achievement.Id);                                           // Achievement ID
     Message.AppendInt32(Level);                                                     // Achieved level
     Message.AppendInt32(144);                                                         // Unknown. Random useless number.
     Message.AppendString(Achievement.GroupName + Level);                   // Achieved name
     Message.AppendInt32(PointReward);                                               // Point reward
     Message.AppendInt32(PixelReward);                                               // Pixel reward
     Message.AppendInt32(0);                                                         // Unknown.
     Message.AppendInt32(10);                                                         // Unknown.
     Message.AppendInt32(21);                                                         // Unknown. (Extra reward?)
     Message.AppendString(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty);
     Message.AppendString(Achievement.Category);
     Message.AppendString(String.Empty);
     Message.AppendInt32(0);
     Message.AppendInt32(0);
     return Message;
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:19,代码来源:AchievementUnlockedComposer.cs


示例13: SerializeFloor

        internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
        {
            Message.AppendUInt(Id);
            Message.AppendString(mBaseItem.Type.ToString().ToUpper());
            Message.AppendUInt(Id);
            Message.AppendInt32(GetBaseItem().SpriteId);
            Message.AppendInt32(Extra); // extra

            Message.AppendInt32(Data.GetTypeID());
            Data.AppendToMessage(Message);

            Message.AppendBoolean(GetBaseItem().AllowRecycle);
            Message.AppendBoolean(GetBaseItem().AllowTrade);
            Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
            Message.AppendBoolean(Marketplace.CanSellItem(this));
            Message.AppendInt32(-1);
            Message.AppendString("");
            Message.AppendInt32(0);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:19,代码来源:UserItem.cs


示例14: Compose

 internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
     int TotalLevels, UserAchievement UserData)
 {
     ServerMessage Message = new ServerMessage(Outgoing.AchievementProgress);
     Message.AppendUInt(Achievement.Id);                                               // Unknown (ID?)
     Message.AppendInt32(TargetLevel);                                                   // Target level
     Message.AppendString(Achievement.GroupName + TargetLevel);                 // Target name/desc/badge
     Message.AppendInt32(TargetLevelData.Requirement);                                   // Progress req/target
     Message.AppendInt32(TargetLevelData.RewardPixels);                                   // Pixel reward
     Message.AppendInt32(TargetLevelData.RewardPoints);                                  // Unknown(??)
     Message.AppendInt32(0); // ?
     Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
     Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
     Message.AppendString(Achievement.Category);                               // Category
     Message.AppendString(String.Empty);
     Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
     Message.AppendInt32(0);
     return Message;
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:19,代码来源:AchievementProgressComposer.cs


示例15: Handle

        public bool Handle(RoomUnit unit, Team team, RoomItem item)
        {
            RoomUser user = unit as RoomUser;
            if (user != null && user.GetClient() != null)
            {
                ServerMessage servermsg = new ServerMessage();
                servermsg.Init(Outgoing.Whisp);
                servermsg.AppendInt32(user.VirtualID);
                servermsg.AppendString(message);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(0);
                servermsg.AppendInt32(-1);

                user.GetClient().SendMessage(servermsg);
                handler.OnEvent(itemID);
                return true;
            }

            return false;
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:20,代码来源:ShowMessage.cs


示例16: TryRedeemVoucher

        internal static void TryRedeemVoucher(GameClient Session, string Code)
        {
            if (!IsValidCode(Code))
            {
                ServerMessage Error = new ServerMessage(Outgoing.VoucherRedeemError);
                Error.AppendRawInt32(0); // 0=invalid code,1=technical issue,3=redeem at webpage
                Session.SendMessage(Error);
                return;
            }

            int Value = GetVoucherValue(Code);

            TryDeleteVoucher(Code);

            Session.GetHabbo().Credits += Value;
            Session.GetHabbo().UpdateCreditsBalance();

            ServerMessage message = new ServerMessage(Outgoing.VoucherRedeemOk);
            message.AppendString("Credits"); // productName
            message.AppendString("Awesome"); // productDescription
            Session.SendMessage(message);
        }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:22,代码来源:VoucherHandler.cs


示例17: Compose

        internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
        {
            ServerMessage Message = new ServerMessage(Outgoing.AchievementList); //436
            Message.AppendInt32(Achievements.Count);

            foreach (Achievement Achievement in Achievements)
            {
                UserAchievement UserData = Session.GetHabbo().GetAchievementData(Achievement.GroupName);
                int TargetLevel = (UserData != null ? UserData.Level + 1 : 1);
                int TotalLevels = Achievement.Levels.Count;

                if (TargetLevel > TotalLevels)
                {
                    TargetLevel = TotalLevels;
                }

                AchievementLevel TargetLevelData = Achievement.Levels[TargetLevel];

                Message.AppendUInt(Achievement.Id);                                                           // Unknown (ID?)
                Message.AppendInt32(TargetLevel);                                                   // Target level
                Message.AppendString(Achievement.GroupName + TargetLevel);                 // Target name/desc/badge
                Message.AppendInt32(TargetLevelData.Requirement);                                   // Progress req/target
                Message.AppendInt32(TargetLevelData.RewardPixels);                                   // Pixel reward
                Message.AppendInt32(TargetLevelData.RewardPoints);                                  // Unknown(??)
                Message.AppendInt32(0);
                Message.AppendInt32(UserData != null ? UserData.Progress : 0);                      // Current progress
                Message.AppendBoolean(UserData != null ? (UserData.Level >= TotalLevels) : false);  // Set 100% completed(??)
                Message.AppendString(Achievement.Category);                                // Category
                Message.AppendString(String.Empty);
                Message.AppendInt32(TotalLevels);                                                   // Total amount of levels
                Message.AppendInt32(0);
            }
            Message.AppendBoolean(false);
            Message.AppendBoolean(false);
            return Message;
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:36,代码来源:AchievementListComposer.cs


示例18: QueueBroadcaseMessage

 internal void QueueBroadcaseMessage(ServerMessage message, string requirements)
 {
     FusedPacket packet = new FusedPacket(message, requirements);
     lock (authorizedPacketSending.SyncRoot)
     {
         authorizedPacketSending.Enqueue(packet);
     }
 }
开发者ID:Kristopher-RZ,项目名称:Firewind,代码行数:8,代码来源:GameClientManager.cs


示例19: massaction

        internal void massaction()
        {
            Room currentRoom = Session.GetHabbo().CurrentRoom;
            if (currentRoom != null)
            {
                if (currentRoom.Owner == Session.GetHabbo().Username && Session.GetHabbo().Rank >= 4)
                {
                    string action = Params[1];
                    int ActionId = 0;

                    switch(action)
                    {
                        case "wave":
                            ActionId = 1;
                            break;

                        case "kiss":
                            ActionId = 2;
                            break;

                        case "laugh":
                            ActionId = 3;
                            break;

                        case "sleep":
                            ActionId = 5;
                            break;

                        default:
                            Session.SendNotif(":massaction wave\n:massaction kiss\n:massaction laugh\n:massaction sleep");
                            return;
                    }

                    List<RoomUser> roomUsers = currentRoom.GetRoomUserManager().GetRoomUsers();
                    foreach (RoomUser user in roomUsers)
                    {
                        user.DanceId = 0;
                        ServerMessage message = new ServerMessage(Outgoing.Action);
                        message.AppendInt32(user.VirtualId);
                        message.AppendInt32(ActionId);
                        currentRoom.SendMessage(message);
                        if (ActionId == 5)
                        {
                            user.IsAsleep = true;
                            ServerMessage message2 = new ServerMessage(Outgoing.IdleStatus);
                            message2.AppendInt32(user.VirtualId);
                            message2.AppendBoolean(user.IsAsleep);
                            currentRoom.SendMessage(message2);
                        }
                    }
                }
            }
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:53,代码来源:ChatCommandHandler.cs


示例20: linkAlert

        internal void linkAlert()
        {
            Room TargetRoom = Session.GetHabbo().CurrentRoom;
            // Hotel Alert pluss link :hal <link> <message>
            string Link = Params[1];

            string Message = MergeParams(Params, 2);

            ServerMessage nMessage = new ServerMessage(Outgoing.SendNotif);
            nMessage.AppendStringWithBreak(LanguageLocale.GetValue("hotelallert.notice") + "\r\n" + Message + "\r\n-" + Session.GetHabbo().Username);
            nMessage.AppendStringWithBreak(Link);
            FirewindEnvironment.GetGame().GetClientManager().QueueBroadcaseMessage(nMessage);

            //FirewindEnvironment.messagingBot.SendMassMessage(new PublicMessage(string.Format("[{0}] => [{1}] + [{2}]", Session.GetHabbo().Username, Link, Message)), true);
        }
开发者ID:TheNaked,项目名称:Firewind,代码行数:15,代码来源:ChatCommandHandler.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.ModernDialog类代码示例发布时间:2022-05-24
下一篇:
C# GameClients.GameClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap