本文整理汇总了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;
}
示例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