本文整理汇总了C#中Silverwave.Messages.ServerMessage.AppendBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendBoolean方法的具体用法?C# ServerMessage.AppendBoolean怎么用?C# ServerMessage.AppendBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Silverwave.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public void Serialize(ServerMessage Message)
{
Message.AppendString(this.Name);
Message.AppendInt32(this.ItemId);
Message.AppendInt32(this.X);
Message.AppendInt32(this.Y);
Message.AppendInt32(0); // Z
Message.AppendInt32(1);
Message.AppendInt32(this.Sprite);
Message.AppendInt32(this.Rot);
Message.AppendInt32(0);
if (this.Name.Contains("background"))
{
Message.AppendBoolean(true);
Message.AppendInt32(1);
Message.AppendInt32(5);
Message.AppendString("state");
Message.AppendString("0");
Message.AppendString("offsetZ");
Message.AppendString("9920");
Message.AppendString("offsetY");
Message.AppendString("1520");
Message.AppendString("imageUrl");
Message.AppendString("http://localhost/c_images/DEV_tests/snst_bg_2_big.png");
Message.AppendString("offsetX");
Message.AppendString("-1070");
}
else
{
Message.AppendBoolean(false);
Message.AppendInt32(0);
Message.AppendString(this.Extradata);
}
}
示例2: Compose
internal static ServerMessage Compose(GameClient Session, Quest Quest)
{
// 518:S,I,I,I,I,B,S,S,I,S,I,I,I,S,S,B,B
int AmountInCat = SilverwaveEnvironment.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(Quest.Category);
int Number = Quest == null ? AmountInCat : Quest.Number;
int UserProgress = Quest == null ? 0 : Session.GetHabbo().GetQuestProgress(Quest.Id);
ServerMessage Message = new ServerMessage(Outgoing.QuestCompletedCompser);
Message.AppendString(Quest.Category);
Message.AppendInt32(Number); // Quest progress in this cat
Message.AppendInt32((Quest.Name.Contains("xmas2012")) ? 1 : AmountInCat); // Total quests in this cat
Message.AppendInt32(Quest == null ? 3 : Quest.RewardType); // Reward type (1 = Snowflakes, 2 = Love hearts, 3 = Pixels, 4 = Seashells, everything else is pixels
Message.AppendInt32(Quest == null ? 0 : Quest.Id); // Quest id
Message.AppendBoolean(Quest == null ? false : Session.GetHabbo().CurrentQuestId == Quest.Id); // Quest started
Message.AppendString(Quest == null ? string.Empty : Quest.ActionName);
Message.AppendString(Quest == null ? string.Empty : Quest.DataBit);
Message.AppendInt32(Quest == null ? 0 : Quest.Reward);
Message.AppendString(Quest == null ? string.Empty : Quest.Name);
Message.AppendInt32(UserProgress); // Current progress
Message.AppendInt32(Quest == null ? 0 : Quest.GoalData); // Target progress
Message.AppendInt32(Quest == null ? 0 : Quest.TimeUnlock); // "Next quest available countdown" in seconds
Message.AppendString("");
Message.AppendString("");
Message.AppendBoolean(true); // ?
Message.AppendBoolean(true); // Activate next quest..
return Message;
}
示例3: SerializeWall
internal void SerializeWall(ServerMessage Message, Boolean Inventory)
{
Message.AppendInt32(Id);
Message.AppendString(mBaseItem.Type.ToString().ToUpper());
Message.AppendInt32(Id);
Message.AppendInt32(GetBaseItem().SpriteId);
if (GetBaseItem().Name.Contains("a2"))
{
Message.AppendInt32(3);
}
else if (GetBaseItem().Name.Contains("wallpaper"))
{
Message.AppendInt32(2);
}
else if (GetBaseItem().Name.Contains("landscape"))
{
Message.AppendInt32(4);
}
else
{
Message.AppendInt32(1);
}
Message.AppendInt32(0);
Message.AppendString(ExtraData);
Message.AppendBoolean(GetBaseItem().AllowRecycle);
Message.AppendBoolean(GetBaseItem().AllowTrade);
Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
Message.AppendBoolean(false);
Message.AppendInt32(-1);
Message.AppendBoolean(true);
Message.AppendInt32(-1);
}
示例4: Compose
internal static ServerMessage Compose(GameClient Session, List<Achievement> Achievements)
{
ServerMessage Message = new ServerMessage(Outgoing.AchievementList);
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.AppendInt32(Achievement.Id); // Unknown (ID?)
Message.AppendInt32(TargetLevel); // Target level
Message.AppendString(Achievement.GroupName + TargetLevel); // Target name/desc/badge
Message.AppendInt32(TargetLevelData.RewardPixels);
Message.AppendInt32(TargetLevelData.Requirement); // Progress req/target
Message.AppendInt32(TargetLevelData.RewardPoints);
Message.AppendInt32(0); // Type of reward
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.AppendString("");
return Message;
}
示例5: Searialize
internal void Searialize(ServerMessage reply)
{
reply.AppendInt32(userID);
reply.AppendString(username);
reply.AppendString(motto);
bool Online = (SilverwaveEnvironment.GetGame().GetClientManager().GetClient(userID) != null);
reply.AppendBoolean(Online);
reply.AppendBoolean(false);
reply.AppendString(string.Empty);
reply.AppendInt32(0);
reply.AppendString(look);
reply.AppendString(last_online);
}
示例6: Compose
internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward)
{
//2210:I,I,I,S,I,I,I,I,I,S,S,B
ServerMessage Message = new ServerMessage(Outgoing.UnlockAchievement);
Message.AppendInt32(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.AppendBoolean(true);
return Message;
}
示例7: Compose
internal static ServerMessage Compose(Achievement Achievement, int TargetLevel, AchievementLevel TargetLevelData,
int TotalLevels, UserAchievement UserData)
{
//I,I,S,I,I,I,I,I,B,S,S,I,I
ServerMessage Message = new ServerMessage(Outgoing.AchievementProgress);
Message.AppendInt32(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.Requirement); // Reward in Pixels
Message.AppendInt32(TargetLevelData.RewardPixels); // Reward Ach Score
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;
}
示例8: Compose
internal static ServerMessage Compose(GameClient Session, List<Quest> Quests, bool Send)
{
Dictionary<string, int> UserQuestGoals = new Dictionary<string, int>();
Dictionary<string, Quest> UserQuests = new Dictionary<string, Quest>();
foreach (Quest Quest in Quests)
{
if (Quest.Category.Contains("xmas2012"))
continue;
if (!UserQuestGoals.ContainsKey(Quest.Category))
{
UserQuestGoals.Add(Quest.Category, 1);
UserQuests.Add(Quest.Category, null);
}
if (Quest.Number >= UserQuestGoals[Quest.Category])
{
int UserProgress = Session.GetHabbo().GetQuestProgress(Quest.Id);
if (Session.GetHabbo().CurrentQuestId != Quest.Id && UserProgress >= Quest.GoalData)
{
UserQuestGoals[Quest.Category] = Quest.Number + 1;
}
}
}
foreach (Quest Quest in Quests)
{
foreach (KeyValuePair<string, int> Goal in UserQuestGoals)
{
if (Quest.Category.Contains("xmas2012"))
continue;
if (Quest.Category == Goal.Key && Quest.Number == Goal.Value)
{
UserQuests[Goal.Key] = Quest;
break;
}
}
}
ServerMessage Message = new ServerMessage(Outgoing.QuestListComposer);
Message.AppendInt32(UserQuests.Count);
// Active ones first
foreach (KeyValuePair<string, Quest> UserQuest in UserQuests)
{
if (UserQuest.Value == null)
{
continue;
}
SerializeQuest(Message, Session, UserQuest.Value, UserQuest.Key);
}
// Dead ones last
foreach (KeyValuePair<string, Quest> UserQuest in UserQuests)
{
if (UserQuest.Value != null)
{
continue;
}
SerializeQuest(Message, Session, UserQuest.Value, UserQuest.Key);
}
Message.AppendBoolean(Send);
return Message;
}
示例9: RoomFloorAndWallComposer
internal ServerMessage RoomFloorAndWallComposer(Room room)
{
//Habbo owner = SilverwaveEnvironment.getHabboForId((uint)room.OwnerId);
//if (owner.GetSubscriptionManager().HasSubscription)
{
ServerMessage m = new ServerMessage(Outgoing.RoomFloorAndWallComposer);
m.AppendBoolean(room.Hidewall == 1);
m.AppendInt32(room.WallThickness);
m.AppendInt32(room.FloorThickness);
return m;
}
}
示例10: AllowAllRide
internal void AllowAllRide()
{
Room Room = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
uint PetID = Request.PopWiredUInt();
RoomUser Pet = Room.GetRoomUserManager().GetPet(PetID);
if (Pet.PetData.AnyoneCanRide == 1)
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
dbClient.runFastQuery("UPDATE bots_petdata SET anyone_ride=0 WHERE id=" + PetID + " LIMIT 1");
Pet.PetData.AnyoneCanRide = 0;
}
else
{
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
dbClient.runFastQuery("UPDATE bots_petdata SET anyone_ride=1 WHERE id=" + PetID + " LIMIT 1");
Pet.PetData.AnyoneCanRide = 1;
}
ServerMessage Nfo = new ServerMessage(Outgoing.PetInformation);
Nfo.AppendInt32(Pet.PetData.PetId);
Nfo.AppendString(Pet.PetData.Name);
Nfo.AppendInt32(Pet.PetData.Level);
Nfo.AppendInt32(20);
Nfo.AppendInt32(Pet.PetData.experience);
Nfo.AppendInt32(Pet.PetData.experienceGoal);
Nfo.AppendInt32(Pet.PetData.Energy);
Nfo.AppendInt32(100);
Nfo.AppendInt32(Pet.PetData.Nutrition);
Nfo.AppendInt32(150);
//Nfo.AppendString(Color.ToLower());
Nfo.AppendInt32(Pet.PetData.Respect);
Nfo.AppendInt32(Pet.PetData.OwnerId);
Nfo.AppendInt32(Pet.PetData.Age);
Nfo.AppendString(Pet.PetData.OwnerName);
Nfo.AppendInt32(1);
Nfo.AppendBoolean(Pet.PetData.HaveSaddle);
Nfo.AppendBoolean(SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Pet.PetData.RoomId).GetRoomUserManager().GetRoomUserByVirtualId(Pet.PetData.VirtualId).RidingHorse);
Nfo.AppendInt32(0);
Nfo.AppendInt32(Pet.PetData.AnyoneCanRide); // Anyone can ride horse
Nfo.AppendInt32(0);
Nfo.AppendInt32(0);
Nfo.AppendInt32(0);
Nfo.AppendInt32(0);
Nfo.AppendInt32(0);
Nfo.AppendInt32(0);
Nfo.AppendString("");
Nfo.AppendBoolean(false);
Nfo.AppendInt32(-1);
Nfo.AppendInt32(-1);
Nfo.AppendInt32(-1);
Nfo.AppendBoolean(false);
Room.SendMessage(Nfo);
}
示例11: AddSaddle
//.........这里部分代码省略.........
Room.GetRoomItemHandler().RemoveFurniture(Session, Item.Id, false);
if (Item.GetBaseItem().Name.Contains("horse_hairdye"))
{
string HairType = Item.GetBaseItem().Name.Split('_')[2];
int HairDye = 48;
HairDye = HairDye + int.Parse(HairType);
PetUser.PetData.HairDye = HairDye;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE bots_petdata SET hairdye = '" + PetUser.PetData.HairDye + "' WHERE id = " + PetUser.PetData.PetId);
}
}
else if (Item.GetBaseItem().Name.Contains("horse_dye"))
{
string Race = Item.GetBaseItem().Name.Split('_')[2];
int Parse = int.Parse(Race);
int RaceLast = 2 + (Parse * 4) - 4;
if (Parse == 13)
RaceLast = 61;
else if (Parse == 14)
RaceLast = 65;
else if (Parse == 15)
RaceLast = 69;
else if (Parse == 16)
RaceLast = 73;
PetUser.PetData.Race = RaceLast.ToString();
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE bots_petdata SET race = '" + PetUser.PetData.Race + "' WHERE id = " + PetUser.PetData.PetId);
dbClient.runFastQuery("DELETE FROM items WHERE id=" + Item.Id + " LIMIT 1");
}
}
else if (Item.GetBaseItem().Name.Contains("horse_hairstyle"))
{
string HairType = Item.GetBaseItem().Name.Split('_')[2];
int Parse = 100;
Parse = Parse + int.Parse(HairType);
PetUser.PetData.PetHair = Parse;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE bots_petdata SET pethair = '" + PetUser.PetData.PetHair + "' WHERE id = " + PetUser.PetData.PetId);
dbClient.runFastQuery("DELETE FROM items WHERE id=" + Item.Id + " LIMIT 1");
}
}
else if (Item.GetBaseItem().Name.Contains("saddle"))
{
PetUser.PetData.HaveSaddle = true;
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE bots_petdata SET have_saddle = 1 WHERE id = " + PetUser.PetData.PetId);
dbClient.runFastQuery("DELETE FROM items WHERE id=" + Item.Id + " LIMIT 1");
}
}
ServerMessage Message = new ServerMessage(Outgoing.PlaceBot);
Message.AppendInt32(1);
PetUser.Serialize(Message, false);
Room.SendMessage(Message);
ServerMessage AddToPet = new ServerMessage(Outgoing.PetData);
AddToPet.AppendInt32(PetUser.PetData.VirtualId);
AddToPet.AppendInt32(PetUser.PetData.PetId);
AddToPet.AppendInt32(PetUser.PetData.Type);
AddToPet.AppendInt32(int.Parse(PetUser.PetData.Race));
AddToPet.AppendString(PetUser.PetData.Color.ToLower());
if (PetUser.PetData.HaveSaddle)
{
AddToPet.AppendInt32(2);
AddToPet.AppendInt32(3);
AddToPet.AppendInt32(4);
AddToPet.AppendInt32(9);
AddToPet.AppendInt32(0);
AddToPet.AppendInt32(3);
AddToPet.AppendInt32(PetUser.PetData.PetHair);
AddToPet.AppendInt32(PetUser.PetData.HairDye);
AddToPet.AppendInt32(3);
AddToPet.AppendInt32(PetUser.PetData.PetHair);
AddToPet.AppendInt32(PetUser.PetData.HairDye);
}
else
{
AddToPet.AppendInt32(1);
AddToPet.AppendInt32(2);
AddToPet.AppendInt32(2);
AddToPet.AppendInt32(PetUser.PetData.PetHair);
AddToPet.AppendInt32(PetUser.PetData.HairDye);
AddToPet.AppendInt32(3);
AddToPet.AppendInt32(PetUser.PetData.PetHair);
AddToPet.AppendInt32(PetUser.PetData.HairDye);
}
AddToPet.AppendBoolean(PetUser.PetData.HaveSaddle);
AddToPet.AppendBoolean(PetUser.RidingHorse);
Room.SendMessage(AddToPet);
}
示例12: tryLogin
internal bool tryLogin(string AuthTicket)
{
try
{
string ip = GetConnection().getIp();
byte errorCode = 0;
UserData userData = UserDataFactory.GetUserData(AuthTicket, ip, out errorCode);
if (errorCode == 1)
{
SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso"));
return false;
}
else if (errorCode == 2)
{
SendNotifWithScroll(LanguageLocale.GetValue("login.loggedin"));
return false;
}
SilverwaveEnvironment.GetGame().GetClientManager().RegisterClient(this, userData.userID, userData.user.Username);
this.Habbo = userData.user;
this.Habbo.SSOTicket = AuthTicket;
userData.user.LoadData(userData);
string banReason = SilverwaveEnvironment.GetGame().GetBanManager().GetBanReason(userData.user.Username, ip, MachineId);
if (!string.IsNullOrEmpty(banReason) || userData.user.Username == null)
{
SendNotifWithScroll(banReason);
Logging.WriteLine("Banned access from " + MachineId, ConsoleColor.Red);
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("SELECT ip_last FROM users WHERE id=" + this.GetHabbo().Id + " LIMIT 1");
string IP = dbClient.getString();
dbClient.setQuery("SELECT COUNT(0) FROM bans_access WHERE user_id=" + this.Habbo.Id + " LIMIT 1");
int Count = dbClient.getInteger();
if (Count > 0)
{
dbClient.runFastQuery("UPDATE bans_access SET attempts = attempts + 1, ip='" + IP + "' WHERE user_id=" + this.GetHabbo().Id + " LIMIT 1");
}
else
{
dbClient.runFastQuery("INSERT INTO bans_access (user_id, ip) VALUES (" + this.GetHabbo().Id + ", '" + IP + "')");
}
}
return false;
}
userData.user.Init(this, userData);
QueuedServerMessage response = new QueuedServerMessage(Connection);
ServerMessage UniqueId = new ServerMessage(Outgoing.UniqueID);
UniqueId.AppendString(this.MachineId);
response.appendResponse(UniqueId);
response.appendResponse(new AuthenticationOKComposer());
if (this.Habbo != null)
{
ServerMessage HomeRoom1 = new ServerMessage(Outgoing.HomeRoom);
HomeRoom1.AppendInt32(this.Habbo.HomeRoom); // first home
HomeRoom1.AppendInt32(this.Habbo.HomeRoom); // current home
response.appendResponse(HomeRoom1);
}
ServerMessage MiniMail = new ServerMessage(Outgoing.SerializeMiniMailCount);
MiniMail.AppendInt32(0);
response.appendResponse(MiniMail);
ServerMessage FavouriteRooms = new ServerMessage(Outgoing.FavouriteRooms);
FavouriteRooms.AppendInt32(30); // max rooms
FavouriteRooms.AppendInt32(userData.user.FavoriteRooms.Count);
foreach (uint Id in userData.user.FavoriteRooms.ToArray())
{
FavouriteRooms.AppendInt32(Id);
}
response.appendResponse(FavouriteRooms);
if (this.GetHabbo().GetAvatarEffectsInventoryComponent() != null)
SendMessage(this.GetHabbo().GetAvatarEffectsInventoryComponent().Serialize());
response.appendResponse(new UserRightsComposer((this.Habbo == null) ? 1 : this.Habbo.Rank));
ServerMessage bools1 = new ServerMessage(Outgoing.bools1);
bools1.AppendBoolean(true);
bools1.AppendBoolean(false);
response.appendResponse(bools1);
ServerMessage StartConsole = new ServerMessage(Outgoing.EnableConsole);
StartConsole.AppendBoolean(true);
response.appendResponse(StartConsole);
//PixelManager.GivePixels(this, 0);
ServerMessage mClient = new ServerMessage(Outgoing.ActivityPoints);
mClient.AppendInt32(11); // ?
mClient.AppendInt32(0);
mClient.AppendInt32(Habbo.ActivityPoints);
//.........这里部分代码省略.........
示例13: SerializeRoomData
internal void SerializeRoomData(ServerMessage Response, bool FromView, GameClient Session, bool SendRoom = false)
{
Room Room = SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
if (Room == null || !Room.CheckRights(Session, true))
{
return;
}
Response.Init(Outgoing.RoomData);
Response.AppendBoolean(true);
Response.AppendInt32(Id);
Response.AppendString(Name);
Response.AppendBoolean(Type == "private");
Response.AppendInt32(OwnerId);
Response.AppendString(Owner);
Response.AppendInt32(State);
Response.AppendInt32(UsersNow);
Response.AppendInt32(UsersMax);
Response.AppendString(Description);
Response.AppendInt32(0); //unused, let be 0
Response.AppendInt32(2);
Response.AppendInt32(Score);
Response.AppendInt32(0); // visible for rank > x
Response.AppendInt32(Category);
if (GroupId > 0)
{
Response.AppendInt32(Group.Id);
Response.AppendString(Group.Name);
Response.AppendString(Group.Badge);
Response.AppendString("");
}
else
{
Response.AppendInt32(0);
Response.AppendString("");
Response.AppendString("");
Response.AppendString("");
}
Response.AppendInt32(TagCount);
foreach (string Tag in Tags.ToArray())
{
Response.AppendString(Tag);
}
//GUESTROOM THUMBNAIL^? disabled
Response.AppendInt32(0); //
Response.AppendInt32(0); //
Response.AppendInt32(0);
//Response.AppendInt32(0);
//GUESROOM THUBNAILS ^
Response.AppendBoolean(AllowPets == 1);
Response.AppendBoolean(AllowPetsEating == 1);
Response.AppendString(""); // EVENT related stuff
Response.AppendString(""); // EVENT related stuff
Response.AppendInt32(0); // EVENT Time Left, in seconds
Response.AppendBoolean(FromView); //staff moderation locking the room ?
Response.AppendBoolean(false);
Response.AppendBoolean(false);
Response.AppendBoolean(false);
Console.WriteLine(WhoCanBan + WhoCanKick + WhoCanMute + ChatType + ChatBalloon);
Response.AppendInt32(WhoCanMute); // who can mute
Response.AppendInt32(WhoCanKick); // who can kick
Response.AppendInt32(WhoCanBan); // who can ban
Response.AppendBoolean(Room.CheckRights(Session, true));
Response.AppendInt32(ChatType); //ChatMode, ChatSize, ChatSpeed, HearingDistance, ExtraFlood is the order.
Response.AppendInt32(ChatBalloon);
Response.AppendInt32(ChatSpeed);
Response.AppendInt32(ChatMaxDistance);
Response.AppendInt32(ChatFloodProtection);
if (SendRoom)
{
if (SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Id) != null)
SilverwaveEnvironment.GetGame().GetRoomManager().GetRoom(Id).SendMessage(Response);
}
else
Session.SendMessage(Response);
}
示例14: SerializeSearchResults
internal ServerMessage SerializeSearchResults(string SearchQuery)
{
DataTable Data = new DataTable();
using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
{
if (SearchQuery.Length > 0)
{
if (SearchQuery.ToLower().StartsWith("owner:"))
{
dbClient.setQuery("SELECT * FROM rooms WHERE owner = @query AND roomtype = 'private' ORDER BY users_now DESC LIMIT 50");
dbClient.addParameter("query", SearchQuery.Remove(0, 6));
}
else
{
dbClient.setQuery("SELECT * FROM rooms WHERE caption LIKE @query OR owner LIKE @query AND roomtype = 'private' ORDER BY users_now DESC LIMIT 50");
dbClient.addParameter("query", "%" + SearchQuery + "%");
}
Data = dbClient.getTable();
}
}
List<RoomData> Results = new List<RoomData>();
if (Data != null)
{
foreach (DataRow Row in Data.Rows)
{
RoomData RData = SilverwaveEnvironment.GetGame().GetRoomManager().FetchRoomData(Convert.ToUInt32(Row["id"]), Row);
Results.Add(RData);
}
}
ServerMessage Message = new ServerMessage(Outgoing.NavigatorPacket);
Message.AppendInt32(8);
Message.AppendString(SearchQuery);
Message.AppendInt32(Results.Count);
foreach (RoomData Room in Results)
{
Room.Serialize(Message, false);
}
Message.AppendBoolean(false);
return Message;
}
示例15: SerializeRecentRooms
internal ServerMessage SerializeRecentRooms(GameClient Session)
{
ServerMessage Rooms = new ServerMessage(Outgoing.NavigatorPacket);
Rooms.AppendInt32(7);
Rooms.AppendString("");
//Rooms.AppendInt32(ValidRecentRooms.Count);
Rooms.AppendInt32(0);
Rooms.AppendBoolean(false);
return Rooms;
}