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


C# ServerMessage.AppendByte方法代码示例

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


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

示例1: SerializeRoomChatlog

        internal static ServerMessage SerializeRoomChatlog(uint roomID)
        {
            // NEW CHATLOGS [March 2014] Coded by Finn
            // Please don't remove credits, this took me some time to do... :(
            // Credits to Itachi for the structure's "context" enigma :D




            ServerMessage Message = new ServerMessage();
            RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);
            if (Room == null)
            {
                throw new NullReferenceException("No room found.");
            }




            Message.Init(Outgoing.RoomChatlog);
            Message.AppendByte(1);
            Message.AppendShort(2);
            Message.AppendString("roomName");
            Message.AppendByte(2);
            Message.AppendString(Room.Name);
            Message.AppendString("roomId");
            Message.AppendByte(1);
            Message.AppendInt32(Room.Id);




            Message.AppendShort(Room.RoomChat.Count);
            Room.RoomChat.Reverse();
            foreach (Chatlog Log in Room.RoomChat)
            {
                Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId);
                DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp);
                if (Habbo == null)
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Log.UserId);
                    Message.AppendString("*User not found*");
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(true);
                }
                else
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Habbo.Id);
                    Message.AppendString(Habbo.Username);
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(false); // Text is bold
                }
            }
            Room.RoomChat.Reverse();
            return Message;
        }
开发者ID:BjkGkh,项目名称:07052014,代码行数:58,代码来源:ModerationTool.cs

示例2: OnTrigger


//.........这里部分代码省略.........
                        message.AppendInt32(items.Count);
                        foreach (RoomItem item in items)
                            message.AppendInt32(item.Id);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendInt32(Item.Id);
                        message.AppendString(ExtraInfo);
                        message.AppendInt32(0);
                        message.AppendInt32(0);
                        message.AppendInt32(7);
                        message.AppendInt32(0);
                        message.AppendInt32(0);
                        message.AppendInt32(0);

                        Session.SendMessage(message);
                        break;
                    }

                case InteractionType.actionteleportto:
                    {
                        ServerMessage message = new ServerMessage(Outgoing.WiredEffect);
                        message.AppendBoolean(false);
                        message.AppendInt32(5);
                        message.AppendInt32(items.Count);
                        foreach (RoomItem item in items)
                            message.AppendInt32(item.Id);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendInt32(Item.Id);
                        message.AppendString(ExtraInfo);
                        message.AppendInt32(0);
                        message.AppendInt32(8);
                        message.AppendInt32(0);
                        message.AppendInt32(Delay);
                        message.AppendInt32(0);
                        message.AppendByte(2);

                        Session.SendMessage(message);
                        break;
                    }

                case InteractionType.actionmoverotate:
                    {
                        ServerMessage message = new ServerMessage(Outgoing.WiredEffect);
                        message.AppendBoolean(false);
                        message.AppendInt32(5);
                        message.AppendInt32(items.Count);
                        foreach (RoomItem item in items)
                            message.AppendInt32(item.Id);
                        message.AppendInt32(Item.GetBaseItem().SpriteId);
                        message.AppendInt32(Item.Id);
                        message.AppendString(ExtraInfo);
                        message.AppendInt32(2);
                        message.AppendInt32(int.Parse(ExtraInfo.Split(';')[0]));
                        message.AppendInt32(int.Parse(ExtraInfo.Split(';')[1]));
                        message.AppendInt32(0);
                        message.AppendInt32(4);
                        message.AppendInt32(Delay);
                        message.AppendInt32(0);
                        message.AppendInt32(0);

                        Session.SendMessage(message);
                        break;
                    }

                #endregion

                #region Add-ons
开发者ID:BjkGkh,项目名称:07052014,代码行数:67,代码来源:InteractorWired.cs


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