本文整理汇总了C#中Silverwave.Messages.ServerMessage.AppendInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendInt32方法的具体用法?C# ServerMessage.AppendInt32怎么用?C# ServerMessage.AppendInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Silverwave.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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;
}
示例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(Outgoing.TradeStart);
Message.AppendInt32(UserOneId);
Message.AppendInt32(1); // ready
Message.AppendInt32(UserTwoId);
Message.AppendInt32(1); // ready
SendMessageToUsers(Message);
}
示例4: DeliverInstantMessage
internal void DeliverInstantMessage(string message, uint convoID)
{
ServerMessage InstantMessage = new ServerMessage(Outgoing.InstantChat);
InstantMessage.AppendInt32(convoID);
InstantMessage.AppendString(message);
InstantMessage.AppendInt32(0);// + string.Empty);
GetClient().SendMessage(InstantMessage);
}
示例5: AccountGameStatusMessage
internal void AccountGameStatusMessage()
{
ServerMessage container = new ServerMessage(Outgoing.Game2AccountGameStatusMessageComposer);
{
container.AppendInt32(Request.PopWiredInt32());
container.AppendInt32(-1);
container.AppendInt32(0);
Session.SendMessage(container);
}
}
示例6: SerializeFloor
internal void SerializeFloor(ServerMessage Message, Boolean Inventory)
{
int result = 0;
if (this.GetBaseItem().InteractionType == InteractionType.gift && ExtraData.Contains(Convert.ToChar(5).ToString()))
{
int color = int.Parse(ExtraData.Split((char)5)[1]);
int lazo = int.Parse(ExtraData.Split((char)5)[2]);
result = color * 1000 + lazo;
}
Message.AppendInt32(Id);
Message.AppendString(mBaseItem.Type.ToString().ToUpper());
Message.AppendInt32(Id);
Message.AppendInt32(GetBaseItem().SpriteId);
if (GetBaseItem().InteractionType == InteractionType.gld_item || this.GetBaseItem().InteractionType == InteractionType.gld_gate)
{
Group Group = SilverwaveEnvironment.GetGame().GetGroupManager().GetGroup(GroupId);
if (Group != null)
{
Message.AppendInt32(17);
Message.AppendInt32(2);
Message.AppendInt32(5);
Message.AppendString(ExtraData);
Message.AppendString(Group.Id.ToString());
Message.AppendString(Group.Badge);
Message.AppendString(SilverwaveEnvironment.GetGame().GetGroupManager().GetGroupColour(Group.Colour1, true)); // Group Colour 1
Message.AppendString(SilverwaveEnvironment.GetGame().GetGroupManager().GetGroupColour(Group.Colour2, false)); // Group Colour 2
}
else
{
Message.AppendInt32(1);
Message.AppendInt32(0);
Message.AppendString(ExtraData);
}
}
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); // Marketplace
Message.AppendInt32(-1); //second to expiration
Message.AppendBoolean(true); //has rent period started
Message.AppendInt32(-1);
Message.AppendString("");
Message.AppendInt32(0);
}
示例7: Compose
internal static ServerMessage Compose(int PlaylistCapacity, List<SongInstance> Playlist)
{
ServerMessage Message = new ServerMessage(Outgoing.ComposeJukebox);
Message.AppendInt32(PlaylistCapacity);
Message.AppendInt32(Playlist.Count);
foreach (SongInstance Song in Playlist)
{
Message.AppendInt32(Song.DiskItem.itemID);
Message.AppendInt32(Song.SongData.Id);
}
return Message;
}
示例8: 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;
}
示例9: SerializeEventListing
internal ServerMessage SerializeEventListing()
{
ServerMessage Message = new ServerMessage(Outgoing.NavigatorPacket);
Message.AppendInt32(16);
Message.AppendString("");
KeyValuePair<RoomData, int>[] eventRooms = SilverwaveEnvironment.GetGame().GetRoomManager().GetEventRooms();
Message.AppendInt32(eventRooms.Length);
foreach (KeyValuePair<RoomData, int> pair in eventRooms)
{
pair.Key.Serialize(Message, true);
}
return Message;
}
示例10: 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);
}
示例11: Serialize
internal void Serialize(ServerMessage Request)
{
// [email protected]22033860
Request.AppendInt32(FromUser);
Request.AppendString(mUsername);
Habbo user = SilverwaveEnvironment.getHabboForName(mUsername);
Request.AppendString((user != null) ? user.Look : "");
}
示例12: SmallPromoComposer
internal ServerMessage SmallPromoComposer(ServerMessage Message)
{
Message.AppendInt32(HotelViewPromosIndexers.Count);
foreach (SmallPromo promo in HotelViewPromosIndexers)
{
promo.Serialize(Message);
}
return Message;
}
示例13: OnTrigger
public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
{
if (Session == null)
return;
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
{
return;
}
if (!((Math.Abs((int)(User.X - Item.GetX)) >= 2) || (Math.Abs((int)(User.Y - Item.GetY)) >= 2)))
{
User.SetRot(Rotation.Calculate(User.X, User.Y, Item.GetX, Item.GetY), false);
if (User.RotBody % 2 != 0)
{
User.MoveTo(Item.GetX + 1, Item.GetY);
return;
}
Room Room = Item.GetRoom();
Point NewPoint = new Point(0, 0);
if (User.RotBody == 4)
{ NewPoint = new Point(Item.GetX, Item.GetY + 1); }
if (User.RotBody == 0)
{ NewPoint = new Point(Item.GetX, Item.GetY - 1); }
if (User.RotBody == 6)
{ NewPoint = new Point(Item.GetX - 1, Item.GetY); }
if (User.RotBody == 2)
{ NewPoint = new Point(Item.GetX + 1, Item.GetY); }
if (Room.GetGameMap().ValidTile(NewPoint.X, NewPoint.Y) && Room.GetGameMap().itemCanBePlacedHere(NewPoint.X, NewPoint.Y) && Room.GetGameMap().CanRollItemHere(NewPoint.X, NewPoint.Y))
{
Double NewZ = Item.GetRoom().GetGameMap().SqAbsoluteHeight(NewPoint.X, NewPoint.Y);
ServerMessage mMessage = new ServerMessage();
mMessage.Init(Outgoing.ObjectOnRoller); // Cf
mMessage.AppendInt32(Item.GetX);
mMessage.AppendInt32(Item.GetY);
mMessage.AppendInt32(NewPoint.X);
mMessage.AppendInt32(NewPoint.Y);
mMessage.AppendInt32(1);
mMessage.AppendInt32(Item.Id);
mMessage.AppendString(Item.GetZ.ToString().Replace(',', '.'));
mMessage.AppendString(NewZ.ToString().Replace(',', '.'));
mMessage.AppendInt32(0);
Room.SendMessage(mMessage);
Item.GetRoom().GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, NewPoint.X, NewPoint.Y, Item.Rot, false, false, false);
}
}
else
{
User.MoveTo(Item.GetX + 1, Item.GetY);
}
}
示例14: OnCycle
public void OnCycle()
{
ServerMessage Response = new ServerMessage();
if (GameState == 0)
{
if (Players.Count >= 1 && NextTimeAction == 0)
{
NextTimeAction = SilverwaveEnvironment.GetUnixTimestamp() + StormConfig.PreGameTimer;
Response.Init(Outgoing.SnowStartLobbyCounter);
Response.AppendInt32(StormConfig.PreGameTimer);
SendToPlayers(Response);
}
else if (Players.Count >= 1 && NextTimeAction < SilverwaveEnvironment.GetUnixTimestamp())
{
GameState = 1;
StartLobby();
NextTimeAction = SilverwaveEnvironment.GetUnixTimestamp() + StormConfig.LobbyTimer;
}
else if (Players.Count < 1 && NextTimeAction > 0)
{
Response.Init(Outgoing.SnowStopLobbyCounter);
SendToPlayers(Response);
NextTimeAction = 0;
}
}
else if (GameState == 1) // In Lobby
{
if (NextTimeAction < SilverwaveEnvironment.GetUnixTimestamp())
{
StartStage();
GameState = 2;
NextTimeAction = SilverwaveEnvironment.GetUnixTimestamp() + 5;
}
}
else if(GameState == 2) // On Snow, Waiting
{
if (NextTimeAction <= SilverwaveEnvironment.GetUnixTimestamp())
{
Response.Init(Outgoing.SnowStageRunning);
Response.AppendInt32(StormConfig.GameLength);
SendToPlayers(Response);
GameState = 3;
}
}
else if (GameState == 3) // Playing
{
CycleStage();
}
//Console.WriteLine("mILLISECONDS: " + (SilverwaveEnvironment.Now() - lastrun).ToString() + " cycle:" + CurrentCycle);
lastrun = SilverwaveEnvironment.Now();
}
示例15: GenerateExtraData
internal ServerMessage GenerateExtraData(ServerMessage Message)
{
Message.AppendInt32(0);
Message.AppendInt32(5);
Message.AppendInt32(4);
Message.AppendInt32(Enabled);
Message.AppendInt32(Data1);
Message.AppendInt32(Data2);
Message.AppendInt32(Data3);
return Message;
}