本文整理汇总了C#中Pici.Messages.ServerMessage.AppendString方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendString方法的具体用法?C# ServerMessage.AppendString怎么用?C# ServerMessage.AppendString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pici.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeliverInstantMessage
internal void DeliverInstantMessage(string message, uint convoID)
{
ServerMessage InstantMessage = new ServerMessage(134);
InstantMessage.AppendUInt(convoID);
InstantMessage.AppendString(message);
GetClient().SendMessage(InstantMessage);
}
示例2: GetRelativeHeightmap
private ServerMessage GetRelativeHeightmap()
{
ServerMessage Message = new ServerMessage(470);
//Needs cache!
for (int y = 0; y < MapSizeY; y++)
{
for (int x = 0; x < MapSizeX; x++)
{
if (x == DoorX && y == DoorY)
Message.AppendString(DoorZ.ToString());
else if (SqState[x, y] == SquareState.BLOCKED)
Message.AppendString("x");
else
Message.AppendString(SqFloorHeight[x, y].ToString());
}
Message.AppendString(Convert.ToChar(13).ToString());
}
return Message;
}
示例3: UpdateUserOnRoller
internal ServerMessage UpdateUserOnRoller(RoomUser pUser, Point pNextCoord, uint pRollerID, Double NextZ)
{
ServerMessage mMessage = new ServerMessage();
mMessage.Init(230); // Cf
mMessage.AppendInt32(pUser.X);
mMessage.AppendInt32(pUser.Y);
mMessage.AppendInt32(pNextCoord.X);
mMessage.AppendInt32(pNextCoord.Y);
mMessage.AppendInt32(0);
mMessage.AppendUInt(pRollerID);
mMessage.AppendString("J");
mMessage.AppendInt32(pUser.VirtualId);
mMessage.AppendStringWithBreak(TextHandling.GetString(pUser.Z));
mMessage.AppendStringWithBreak(TextHandling.GetString(NextZ));
room.GetGameMap().UpdateUserMovement(new Point(pUser.X, pUser.Y), new Point(pNextCoord.X, pNextCoord.Y), pUser);
room.GetGameMap().GameMap[pUser.X, pUser.Y] = 1;
pUser.X = pNextCoord.X;
pUser.Y = pNextCoord.Y;
pUser.Z = NextZ;
room.GetGameMap().GameMap[pUser.X, pUser.Y] = 0;
return mMessage;
}
示例4: OnTrigger
internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Session != null)
return;
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
Point ItemCoordx1 = new Point(Item.Coordinate.X + 1, Item.Coordinate.Y);
Point ItemCoordx2 = new Point(Item.Coordinate.X - 1, Item.Coordinate.Y);
Point ItemCoordy1 = new Point(Item.Coordinate.X, Item.Coordinate.Y + 1);
Point ItemCoordy2 = new Point(Item.Coordinate.X, Item.Coordinate.Y - 1);
if (User == null)
{
return;
}
if (User.Coordinate != ItemCoordx1 && User.Coordinate != ItemCoordx2 && User.Coordinate != ItemCoordy1 && User.Coordinate != ItemCoordy2)
{
if (User.CanWalk)
{
User.MoveTo(Item.SquareInFront);
return;
}
}
else
{
int NewX = Item.Coordinate.X;
int NewY = Item.Coordinate.Y;
if (User.Coordinate == ItemCoordx1)
{
NewX = Item.Coordinate.X - 1;
NewY = Item.Coordinate.Y;
}
else if (User.Coordinate == ItemCoordx2)
{
NewX = Item.Coordinate.X + 1;
NewY = Item.Coordinate.Y;
}
else if (User.Coordinate == ItemCoordy1)
{
NewX = Item.Coordinate.X;
NewY = Item.Coordinate.Y - 1;
}
else if (User.Coordinate == ItemCoordy2)
{
NewX = Item.Coordinate.X;
NewY = Item.Coordinate.Y + 1;
}
if (Item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
{
Double NewZ = Item.GetRoom().GetGameMap().SqAbsoluteHeight(NewX, NewY);
ServerMessage Message = new ServerMessage(230);
Message.AppendInt32(Item.Coordinate.X);
Message.AppendInt32(Item.Coordinate.Y);
Message.AppendInt32(NewX);
Message.AppendInt32(NewY);
Message.AppendInt32(1);
Message.AppendUInt(Item.Id);
Message.AppendByte(2);
Message.AppendStringWithBreak(TextHandling.GetString(NewZ));
Message.AppendString("M");
Item.GetRoom().SendMessage(Message);
Item.GetRoom().GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, NewX, NewY, Item.Rot, false, false, true);
}
}
}
示例5: UpdateBadges
internal void UpdateBadges()
{
Session.GetHabbo().GetBadgeComponent().ResetSlots();
using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.runFastQuery("UPDATE user_badges SET badge_slot = 0 WHERE user_id = " + Session.GetHabbo().Id);
}
if (Request.RemainingLength > 0)
{
while (Request.RemainingLength > 0)
{
int Slot = Request.PopWiredInt32();
string Badge = Request.PopFixedString();
if (Badge.Length == 0)
{
continue;
}
if (!Session.GetHabbo().GetBadgeComponent().HasBadge(Badge) || Slot < 1 || Slot > 5)
{
return;
}
Session.GetHabbo().GetBadgeComponent().GetBadge(Badge).Slot = Slot;
using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
{
dbClient.setQuery("UPDATE user_badges SET badge_slot = " + Slot + " WHERE badge_id = @badge AND user_id = " + Session.GetHabbo().Id + "");
dbClient.addParameter("badge", Badge);
dbClient.runQuery();
}
}
PiciEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, HabboHotel.Quests.QuestType.PROFILE_BADGE);
}
ServerMessage Message = new ServerMessage(228);
Message.AppendUInt(Session.GetHabbo().Id);
Message.AppendInt32(Session.GetHabbo().GetBadgeComponent().EquippedCount);
foreach (Badge Badge in Session.GetHabbo().GetBadgeComponent().BadgeList.Values)
{
if (Badge.Slot <= 0)
{
continue;
}
Message.AppendInt32(Badge.Slot);
Message.AppendString(Badge.Code);
}
if (Session.GetHabbo().InRoom && PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId) != null)
{
PiciEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).SendMessage(Message);
}
else
{
Session.SendMessage(Message);
}
}
示例6: Serialize
internal ServerMessage Serialize()
{
var EquippedBadges = new List<Badge>();
ServerMessage Message = new ServerMessage(229);
Message.AppendInt32(Count);
foreach (Badge Badge in Badges.Values)
{
Message.AppendInt32(0);
Message.AppendStringWithBreak(Badge.Code);
if (Badge.Slot > 0)
{
EquippedBadges.Add(Badge);
}
}
Message.AppendInt32(EquippedBadges.Count);
foreach (Badge Badge in EquippedBadges)
{
Message.AppendInt32(Badge.Slot);
Message.AppendString(Badge.Code);
}
return Message;
}