本文整理汇总了C#中Silverwave.Messages.ServerMessage.AppendShort方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendShort方法的具体用法?C# ServerMessage.AppendShort怎么用?C# ServerMessage.AppendShort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Silverwave.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendShort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
internal void Serialize(ServerMessage Message, GameClient Session)
{
var Relationship = Session.GetHabbo().Relationships.FirstOrDefault(x => x.Value.UserId == Convert.ToInt32(UserId)).Value;
int y = Relationship == null ? 0 : Relationship.Type;
Message.AppendInt32(UserId);
Message.AppendString(mUsername);
Message.AppendInt32(1);
if (!mAppearOffline || Session.GetHabbo().Rank >= 4)
Message.AppendBoolean(IsOnline);
else
Message.AppendBoolean(false);
if (!mHideInroom || Session.GetHabbo().Rank >= 4)
Message.AppendBoolean(InRoom);
else
Message.AppendBoolean(false);
Message.AppendString(IsOnline ? mLook : "");
Message.AppendInt32(0); // categoryid
Message.AppendString(mMotto);
Message.AppendString(string.Empty); // Facebook username
Message.AppendString(string.Empty);
Message.AppendBoolean(true); // Allows offline messaging
Message.AppendBoolean(false); // ?
Message.AppendBoolean(false); // Uses phone
Message.AppendShort(y);
}
示例2: GetRelativeHeightmap
private ServerMessage GetRelativeHeightmap()
{
int area = MapSizeX * MapSizeY;
ServerMessage Message = new ServerMessage(Outgoing.RelativeMap);
Message.AppendInt32(MapSizeX);
Message.AppendInt32(area);
//int count = 0;
for( int y = 0; y < MapSizeY; y++)
{
for (int x = 0; x < MapSizeX; x++)
{
if (SqState[x, y] == SquareState.BLOCKED)
Message.AppendShort(-1);
else
Message.AppendShort(SqFloorHeight[x,y]<<8);
//count++;
}
}
return Message;
}
示例3: 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;
}