本文整理汇总了C#中Reality.Communication.ClientMessage.PopWiredUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# ClientMessage.PopWiredUInt32方法的具体用法?C# ClientMessage.PopWiredUInt32怎么用?C# ClientMessage.PopWiredUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reality.Communication.ClientMessage
的用法示例。
在下文中一共展示了ClientMessage.PopWiredUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteSticky
private static void DeleteSticky(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session, true))
{
return;
}
Item Item = Instance.GetItem(Message.PopWiredUInt32());
if (Item == null || Item.Definition.Behavior != ItemBehavior.StickyNote)
{
return;
}
if (Instance.TakeItem(Item.Id))
{
Instance.RegenerateRelativeHeightmap();
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
Item.RemovePermanently(MySqlClient);
}
}
}
示例2: BanUser
private static void BanUser(Session Session, ClientMessage Message)
{
if (!Session.HasRight("moderation_tool"))
{
return;
}
uint UserId = Message.PopWiredUInt32();
string MessageText = Message.PopString();
double Length = (Message.PopWiredInt32() * 3600);
Session TargetSession = SessionManager.GetSessionByCharacterId(UserId);
if (TargetSession == null || TargetSession.HasRight("moderation_tool"))
{
Session.SendData(NotificationMessageComposer.Compose("This user is not online or you do not have permission to ban them.\nPlease use housekeeping to ban users that are offline."));
return;
}
SessionManager.StopSession(TargetSession.Id);
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
ModerationBanManager.BanUser(MySqlClient, UserId, MessageText, Session.CharacterId, Length);
ModerationLogs.LogModerationAction(MySqlClient, Session, "Banned user",
"User '" + TargetSession.CharacterInfo.Username + "' (ID " + TargetSession.CharacterId + ") for " +
Length + " hours: '" + MessageText + "'");
}
}
示例3: MoveWallItem
private static void MoveWallItem(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session))
{
return;
}
Item Item = Instance.GetItem(Message.PopWiredUInt32());
if (Item == null || Item.Definition.Type != ItemType.WallItem)
{
return;
}
string RawPlacementData = Message.PopString();
string WallPos = Instance.SetWallItem(Session, RawPlacementData, Item);
if (WallPos.Length > 0)
{
Item.MoveToRoom(null, Instance.RoomId, new Vector3(0, 0, 0), 0, WallPos);
RoomManager.MarkWriteback(Item, false);
Instance.BroadcastMessage(RoomWallItemMovedComposer.Compose(Item));
ItemEventDispatcher.InvokeItemEventHandler(Session, Item, Instance, ItemEventType.Moved);
}
}
示例4: TakeRights
private static void TakeRights(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session, true))
{
return;
}
int Amount = Message.PopWiredInt32();
for (int i = 0; (i < Amount && i <= 100); i++)
{
uint UserId = Message.PopWiredUInt32();
if (UserId > 0 && Instance.TakeUserRights(UserId))
{
Session.SendData(RoomRightsRemovedConfirmationComposer.Compose(Instance.RoomId, UserId));
}
}
}
示例5: MoveFloorItem
private static void MoveFloorItem(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session))
{
return;
}
Item Item = Instance.GetItem(Message.PopWiredUInt32());
if (Item == null || Item.Definition.Type != ItemType.FloorItem)
{
return;
}
Vector2 NewPosition = new Vector2(Message.PopWiredInt32(), Message.PopWiredInt32());
int NewRotation = Message.PopWiredInt32();
bool IsRotationOnly = (Item.RoomId == Instance.RoomId && Item.RoomPosition.X == NewPosition.X &&
Item.RoomPosition.Y == NewPosition.Y && NewRotation != Item.RoomRotation);
Vector3 FinalizedPosition = Instance.SetFloorItem(Session, Item, NewPosition, NewRotation);
if (FinalizedPosition != null)
{
Item.MoveToRoom(null, Instance.RoomId, FinalizedPosition, NewRotation, string.Empty);
RoomManager.MarkWriteback(Item, false);
Instance.RegenerateRelativeHeightmap();
Instance.BroadcastMessage(RoomItemUpdatedComposer.Compose(Item));
ItemEventDispatcher.InvokeItemEventHandler(Session, Item, Instance, ItemEventType.Moved,
IsRotationOnly ? 1 : 0);
QuestManager.ProgressUserQuest(Session, IsRotationOnly ? QuestType.FURNI_ROTATE : QuestType.FURNI_MOVE);
if (FinalizedPosition.Z > Instance.Model.Heightmap.FloorHeight[FinalizedPosition.X, FinalizedPosition.Y])
{
QuestManager.ProgressUserQuest(Session, QuestType.FURNI_STACK);
}
}
}
示例6: ApplyDecoration
private static void ApplyDecoration(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session, true))
{
return;
}
Item Item = Session.InventoryCache.GetItem(Message.PopWiredUInt32());
if (Item == null)
{
return;
}
string DecorationKey = string.Empty;
switch (Item.Definition.Behavior)
{
case ItemBehavior.Floor:
QuestManager.ProgressUserQuest(Session, QuestType.FURNI_DECORATION_FLOOR);
DecorationKey = "floor";
break;
case ItemBehavior.Wallpaper:
QuestManager.ProgressUserQuest(Session, QuestType.FURNI_DECORATION_WALL);
DecorationKey = "wallpaper";
break;
case ItemBehavior.Landscape:
DecorationKey = "landscape";
break;
}
if (DecorationKey.Length == 0)
{
return;
}
Session.InventoryCache.RemoveItem(Item.Id);
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
Item.RemovePermanently(MySqlClient);
Instance.Info.ApplyDecoration(MySqlClient, DecorationKey, Item.Flags);
}
Instance.BroadcastMessage(RoomDecorationComposer.Compose(DecorationKey, Item.Flags));
Session.SendData(InventoryItemRemovedComposer.Compose(Item.Id));
}
示例7: AddFavorite
private static void AddFavorite(Session Session, ClientMessage Message)
{
if (Session.HasRight("hotel_admin"))
{
uint RoomId = Message.PopWiredUInt32();
if (Session.FavoriteRoomsCache.AddRoomToFavorites(RoomId))
{
Session.SendData(NavigatorFavoriteRoomsChanged.Compose(RoomId, true));
}
ClearCacheGroup(Session.CharacterId);
}
}
示例8: PlacePet
private static void PlacePet(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || (!Instance.CheckUserRights(Session, true) && !Instance.Info.AllowPets))
{
return;
}
Pet Pet = Session.PetInventoryCache.GetPet(Message.PopWiredUInt32());
if (Pet == null)
{
return;
}
Vector2 DesiredPosition = new Vector2(Message.PopWiredInt32(), Message.PopWiredInt32());
if (!Instance.IsValidPosition(DesiredPosition))
{
return;
}
Bot BotDefinition = BotManager.GetHandlerDefinitionForPetType(Pet.Type);
if (BotDefinition == null)
{
Session.SendData(NotificationMessageComposer.Compose("This pet cannot be placed right now. Please try again later."));
return;
}
if (!Instance.CanPlacePet(Instance.CheckUserRights(Session, true)))
{
Session.SendData(RoomItemPlacementErrorComposer.Compose(RoomItemPlacementErrorCode.PetLimitReached));
return;
}
Vector3 Position = new Vector3(DesiredPosition.X, DesiredPosition.Y, Instance.GetUserStepHeight(DesiredPosition));
Pet.MoveToRoom(Instance.RoomId, Position);
Instance.AddBotToRoom(BotManager.CreateNewInstance(BotDefinition, Instance.RoomId, Position, Pet));
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
Pet.SynchronizeDatabase(MySqlClient);
}
Session.SendData(InventoryPetRemovedComposer.Compose(Pet.Id));
}
示例9: SaveBranding
private static void SaveBranding(Session Session, ClientMessage Message)
{
uint ItemId = Message.PopWiredUInt32();
uint Data = Message.PopWiredUInt32();
string Brand = Message.PopString();
string Brand2 = Message.PopString();
string Brand3 = Message.PopString();
string Brand4 = Message.PopString();
string Brand5 = Message.PopString();
string Brand6 = Message.PopString();
string Brand7 = Message.PopString();
string Brand8 = Message.PopString();
string Brand9 = Message.PopString();
string Brand10 = Message.PopString();
string BrandData = Brand + "=" + Brand2 + Convert.ToChar(9) + Brand3 + "=" + Brand4 + Convert.ToChar(9) + Brand5 + "=" + Brand6 + Convert.ToChar(9) + Brand7 + "=" + Brand8 + Convert.ToChar(9) + Brand9 + "=" + Brand10 + Convert.ToChar(9) + "state=0";
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
Item Item = Instance.GetItem(ItemId);
Item.Flags = BrandData;
Item.DisplayFlags = BrandData;
RoomManager.MarkWriteback(Item, true);
Item.BroadcastStateUpdate(Instance);
Instance.RegenerateRelativeHeightmap();
}
示例10: GetUserBadges
private static void GetUserBadges(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null)
{
return;
}
Session TargetSession = SessionManager.GetSessionByCharacterId(Message.PopWiredUInt32());
if (TargetSession == null)
{
return;
}
Session.SendData(RoomUserBadgesComposer.Compose(TargetSession.CharacterId,
TargetSession.BadgeCache.EquippedBadges));
}
示例11: GetUserTags
private static void GetUserTags(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null)
{
return;
}
RoomActor Actor = Instance.GetActorByReferenceId(Message.PopWiredUInt32());
if (Actor == null)
{
return;
}
CharacterInfo Info = (CharacterInfo)Actor.ReferenceObject;
Session.SendData(RoomUserTagsComposer.Compose(Info.Id, Info.Tags));
}
示例12: GetPublicRoomData
private static void GetPublicRoomData(Session Session, ClientMessage Message)
{
uint RoomId = Message.PopWiredUInt32();
RoomInfo Info = RoomInfoLoader.GetRoomInfo(RoomId);
if (Info == null)
{
return;
}
ServerMessage PubRoomData = new ServerMessage(OpcodesOut.ROOM_PUBLIC_MODELDATA);
PubRoomData.AppendUInt32(27); // Unknown.
PubRoomData.AppendStringWithBreak(Info.SWFs);
PubRoomData.AppendUInt32(Info.Id);
Session.SendData(PubRoomData);
}
示例13: GetRoomInfo
private static void GetRoomInfo(Session Session, ClientMessage Message)
{
RoomInfo Info = RoomInfoLoader.GetRoomInfo(Message.PopWiredUInt32());
if (Info == null)
{
return;
}
bool Bool1 = Message.PopWiredBoolean(); // true when entering a room, otherwise always false
bool Bool2 = Message.PopWiredBoolean(); // true when requesting info before entering (stalking etc), otherwise always false??
Session.SendData(RoomInfoComposer.Compose(Info, Bool1, Bool2));
}
示例14: GetGroupBadges
private static void GetGroupBadges(Session Session, ClientMessage Message)
{
int groupid = 1;
uint uId = Message.PopWiredUInt32();
string badge = "b1101Xs21105s21103s211342d1e378ce1b2c021cc190f58003f484d";
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.AbsoluteRoomId);
if (Instance == null)
{
return;
}
using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
{
DataTable Table = MySqlClient.ExecuteQueryTable("SELECT * FROM groups_details");
foreach (DataRow Row in Table.Rows)
{
groupid = (int)Row["id"];
DataRow Description = MySqlClient.ExecuteQueryRow("SELECT * FROM groups_details where id = '" + groupid + "'");
badge = Description["badge"].ToString();
ServerMessage xMessage = new ServerMessage(309);
// count
// foreach => group id
// => string/wb badge code
xMessage.AppendBoolean(true); // something
xMessage.AppendInt32(groupid); // group id
xMessage.AppendStringWithBreak(badge); //badge code
Session.SendData(xMessage);
}
}
}
示例15: EditRoom
private static void EditRoom(Session Session, ClientMessage Message)
{
RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);
if (Instance == null || !Instance.CheckUserRights(Session, true))
{
return;
}
// [email protected]'s [email protected] is where I handle business. [email protected]@[email protected]@IbuttsechsAAAA
uint Id = Message.PopWiredUInt32();
if (Id != Instance.RoomId)
{
return;
}
string Name = UserInputFilter.FilterString(Message.PopString()).Trim();
string Description = UserInputFilter.FilterString(Message.PopString()).Trim();
RoomAccessType AccessType = (RoomAccessType)Message.PopWiredInt32();
string Password = UserInputFilter.FilterString(Message.PopString()).Trim();
int UserLimit = Message.PopWiredInt32();
int CategoryId = Message.PopWiredInt32();
int TagCount = Message.PopWiredInt32();
List<string> Tags = new List<string>();
for (int i = 0; (i < TagCount && i < 2); i++)
{
string Tag = UserInputFilter.FilterString(Message.PopString()).Trim().ToLower();
if (Tag.Length > 32)
{
Tag = Tag.Substring(0, 32);
}
if (Tag.Length > 0 && !Tags.Contains(Tag))
{
Tags.Add(Tag);
}
}
bool AllowPets = (Message.ReadBytes(1)[0] == 65);
bool AllowPetEating = (Message.ReadBytes(1)[0] == 65);
bool AllowBlocking = (Message.ReadBytes(1)[0] == 65);
bool HideWalls = (Message.ReadBytes(1)[0] == 65);
int WallThickness = Message.PopWiredInt32();
int FloorThickness = Message.PopWiredInt32();
if (WallThickness < -2 || WallThickness > 1)
{
WallThickness = 0;
}
if (FloorThickness < -2 || FloorThickness > 1)
{
FloorThickness = 0;
}
if (HideWalls && !Session.HasRight("club_vip"))
{
HideWalls = false;
}
if (Name.Length > 60) // was 25
{
Name = Name.Substring(0, 60);
}
if (Description.Length > 128)
{
Description = Description.Substring(0, 128);
}
if (Password.Length > 64)
{
Password = Password.Substring(0, 64);
}
if (UserLimit > Instance.Model.MaxUsers)
{
UserLimit = Instance.Model.MaxUsers;
}
if (Name.Length == 0)
{
Name = "Room";
}
if (AccessType == RoomAccessType.PasswordProtected && Password.Length == 0)
{
AccessType = RoomAccessType.Open;
}
Instance.Info.EditRoom(Name, Description, AccessType, Password, UserLimit, CategoryId, Tags, AllowPets,
AllowPetEating, AllowBlocking, HideWalls, WallThickness, FloorThickness);
Session.SendData(RoomUpdatedNotification1Composer.Compose(Instance.RoomId));
Instance.BroadcastMessage(RoomUpdatedNotification2Composer.Compose(Instance.RoomId));
//.........这里部分代码省略.........