本文整理汇总了C#中ServerMessage.AppendBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendBoolean方法的具体用法?C# ServerMessage.AppendBoolean怎么用?C# ServerMessage.AppendBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compose
public static ServerMessage Compose(bool Bool1, bool Bool2)
{
ServerMessage Message = new ServerMessage(OpcodesOut.CATALOG_RECYLCER_CONFIG);
Message.AppendBoolean(Bool1);
Message.AppendBoolean(Bool2);
return Message;
}
示例2: Compose
public static ServerMessage Compose(ClubSubscription SubscriptionManager, bool BoughtFromCatalog = false)
{
TimeSpan TimeSpan = SubscriptionManager.ExpireDateTime - DateTime.Now;
int DisplayMonths = 0;
int DisplayDays = 0;
if (TimeSpan.TotalSeconds > 0)
{
DisplayMonths = (int)Math.Floor((double)(TimeSpan.Days / 31.0));
DisplayDays = TimeSpan.Days - (31 * DisplayMonths);
}
// @Gclub_habboSGRBHJIH[MAHHHH
ServerMessage Message = new ServerMessage(OpcodesOut.SUBSCRIPTION_STATUS);
Message.AppendStringWithBreak("habbo_club");
Message.AppendInt32(DisplayDays); // days left in the current month
Message.AppendBoolean(SubscriptionManager.IsActive); // 1 if not expired
Message.AppendInt32(DisplayMonths); // months left after the current month
Message.AppendInt32(BoughtFromCatalog ? 2 : 1); // was true even w/o subscription
Message.AppendInt32(1); // Unknown (Gift points?)
Message.AppendBoolean(SubscriptionManager.IsActive && SubscriptionManager.SubscriptionLevel == ClubSubscriptionLevel.VipClub); // Is VIP (boolean)
Message.AppendInt32((int)(SubscriptionManager.PastHcTime / 86400)); // Past HC Days
Message.AppendInt32((int)(SubscriptionManager.PastVipTime / 86400)); // Past VIP Days
Message.AppendInt32(0); // Discount message enable (boolean)
Message.AppendInt32(30); // Discount message => "Regular price"
Message.AppendInt32(25); // Discount message => "Your price"
return Message;
}
示例3: Trade
internal Trade(UInt32 UserOneId, UInt32 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().Statusses.ContainsKey("trd"))
{
User.GetRoomUser().AddStatus("trd", "");
User.GetRoomUser().UpdateNeeded = true;
}
}
ServerMessage Message = new ServerMessage(104);
Message.AppendUInt(UserOneId);
Message.AppendBoolean(true);
Message.AppendUInt(UserTwoId);
Message.AppendBoolean(true);
SendMessageToUsers(Message);
}
示例4: Compose
public static ServerMessage Compose(uint ActorId, string MessageText, int EmotionId, ChatType ChatType)
{
StringBuilder TextBuilder = new StringBuilder();
Dictionary<int, string> LinkRefs = new Dictionary<int, string>();
string[] Bits = MessageText.Split(' ');
int i = 0;
int j = 0;
foreach (string Bit in Bits)
{
if (j > 0)
{
TextBuilder.Append(' ');
}
if (Bit.StartsWith("http://"))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else if (Bit.StartsWith("www."))
{
LinkRefs.Add(i, Bit);
TextBuilder.Append("{" + i++ + "}");
}
else
{
TextBuilder.Append(Bit);
}
j++;
}
ServerMessage Message = new ServerMessage(ChatType == ChatType.Say ? OpcodesOut.ROOM_CHAT_SAY : (ChatType ==
ChatType.Whisper ? OpcodesOut.ROOM_CHAT_WHISPER : OpcodesOut.ROOM_CHAT_SHOUT));
Message.AppendUInt32(ActorId);
Message.AppendStringWithBreak(TextBuilder.ToString());
Message.AppendInt32(EmotionId);
Message.AppendInt32(LinkRefs.Count);
foreach (KeyValuePair<int, string> LinkedRef in LinkRefs)
{
string Url = LinkedRef.Value;
if (!Url.StartsWith("http://"))
{
Url = "http://" + Url;
}
Message.AppendStringWithBreak("/link_to.php?url=" + HttpUtility.UrlEncode(Url) + "&hash=xx");
Message.AppendStringWithBreak(LinkedRef.Value);
Message.AppendBoolean(false); // Trusted URL (instaopen)
}
Message.AppendInt32(0); // No idea
Message.AppendBoolean(true);
return Message;
}
示例5: 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;
}
示例6: 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);
}
}
示例7: Compose
public static ServerMessage Compose(ReadOnlyCollection<uint> Friends)
{
// @LXKAXKAXVBXaCHIkXuzd0zoNeXxIHHH01-01-2011 13:18:32Alex BrookerPYQA
ServerMessage Message = new ServerMessage(OpcodesOut.MESSENGER_FRIENDS_LIST);
Message.AppendInt32(300);
Message.AppendInt32(300);
Message.AppendInt32(800);
Message.AppendInt32(1100);
Message.AppendInt32(0); // unknown. club membership limits y/n maybe??
Message.AppendInt32(Friends.Count);
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
foreach (uint FriendId in Friends)
{
CharacterInfo Info = CharacterInfoLoader.GetCharacterInfo(MySqlClient, FriendId);
if (Info == null)
{
continue;
}
Session Session = SessionManager.GetSessionByCharacterId(Info.Id);
Message.AppendUInt32(Info.Id);
Message.AppendStringWithBreak(Info.Username);
Message.AppendBoolean(true);
Message.AppendBoolean(Info.HasLinkedSession);
Message.AppendBoolean(Session != null && Session.InRoom);
Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Figure : string.Empty);
Message.AppendBoolean(false);
Message.AppendStringWithBreak(Info.HasLinkedSession ? Info.Motto : string.Empty);
if (Info.HasLinkedSession)
{
Message.AppendStringWithBreak(string.Empty);
}
else
{
DateTime LastOnline = UnixTimestamp.GetDateTimeFromUnixTimestamp(Info.TimestampLastOnline);
Message.AppendStringWithBreak(LastOnline.ToShortDateString() + " " + LastOnline.ToShortTimeString());
}
Message.AppendStringWithBreak(Info.RealName);
Message.AppendStringWithBreak(string.Empty); // Unknown - since RELEASE63-33530-33497
}
}
return Message;
}
示例8: Compose
public static ServerMessage Compose(uint ItemId, bool CanGift)
{
ServerMessage Message = new ServerMessage(OpcodesOut.CATALOG_CAN_GIFT);
Message.AppendUInt32(ItemId);
Message.AppendBoolean(false/*CanGift*/);
return Message;
}
示例9: Compose
public static ServerMessage Compose(uint UserId, bool Accept)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_TRADE_ACCEPT_STATE);
Message.AppendUInt32(UserId);
Message.AppendBoolean(Accept);
return Message;
}
示例10: Compose
public static ServerMessage Compose(uint RoomId)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_UPDATED_NOTIFICATION_3);
Message.AppendUInt32(RoomId);
Message.AppendBoolean(true);
return Message;
}
示例11: Compose
public static ServerMessage Compose(uint RoomId, bool Added)
{
ServerMessage Message = new ServerMessage(OpcodesOut.NAVIGATOR_FAVORITE_ROOMS_CHANGED);
Message.AppendUInt32(RoomId);
Message.AppendBoolean(Added);
return Message;
}
示例12: Compose
public static ServerMessage Compose(int ErrorCode)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_EVENT_CAN_CREATE);
Message.AppendBoolean(ErrorCode < 1);
Message.AppendInt32(ErrorCode);
return Message;
}
示例13: Compoze
public static ServerMessage Compoze(uint ActorId, bool IsTyping)
{
ServerMessage Message = new ServerMessage(OpcodesOut.ROOM_USER_TYPING);
Message.AppendUInt32(ActorId);
Message.AppendBoolean(IsTyping);
return Message;
}
示例14: 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;
}
示例15: Compose
public static ServerMessage Compose(bool Success, uint ItemId)
{
ServerMessage Message = new ServerMessage(OpcodesOut.CATALOG_RECYCLER_RESULT);
Message.AppendBoolean(Success);
Message.AppendUInt32(ItemId);
return Message;
}