本文整理汇总了C#中BrickEmulator.HabboHotel.Users.Client类的典型用法代码示例。如果您正苦于以下问题:C# Client类的具体用法?C# Client怎么用?C# Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Client类属于BrickEmulator.HabboHotel.Users命名空间,在下文中一共展示了Client类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddUserToGroup
private void AddUserToGroup(Client Client, SiteRequest Request)
{
int ItemId = Request.PopInt32();
if (ItemId <= 0)
{
return;
}
int FriendId = Request.PopInt32();
if (FriendId <= 0)
{
return;
}
int CategoryId = Request.PopInt32();
if (CategoryId <= 0)
{
return;
}
BrickEngine.GetMessengerHandler().AddUserToGroup(ItemId, Request.GetUserId(), FriendId, CategoryId);
}
示例2: GetEcotronInfo
private void GetEcotronInfo(Client Client, Request Request)
{
Response Response = new Response(507);
Response.AppendInt32(BrickEngine.GetEcotronReactor().GetTimerTime(Client.GetUser().HabboId));
Response.AppendInt32(BrickEngine.GetEcotronReactor().GetTimeToWait(Client.GetUser().HabboId));
Client.SendResponse(Response);
}
示例3: GainReward
public Boolean GainReward(Client Client)
{
EcotronReward Reward = DeliverReward();
if (Reward == null)
{
return false;
}
BaseItem EcotronBox = BrickEngine.GetFurniReactor().GetSpecifiqueItem("ecotron_box");
if (EcotronBox == null)
{
return false;
}
int BoxId = BrickEngine.GetItemReactor().InsertItem(Client.GetUser().HabboId, EcotronBox.Id, DateTime.Now.ToShortDateString(), Reward.BaseId);
Response Response = new Response(832);
Response.AppendInt32(1);
Response.AppendInt32(EcotronBox.InternalType.ToLower().Equals("s") ? 1 : 2);
Response.AppendInt32(1);
Response.AppendInt32(BoxId);
Client.SendResponse(Response);
Response Box = new Response(508);
Box.AppendBoolean(true);
Box.AppendInt32(BoxId);
Client.SendResponse(Box);
TimeToWait.Add(Client.GetUser().HabboId, DateTime.Now.AddMinutes(3));
return true;
}
示例4: BeginLoadRoom
public void BeginLoadRoom(Client Client, int RoomId, string Password)
{
if (Client.GetUser().PreparingRoomId == RoomId)
{
return;
}
VirtualRoom Room = BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive);
if (Room == null)
{
ClearLoading(Client, true);
return;
}
if (BrickEngine.GetRoomReactor().GetRoomModel(Room.ModelParam) == null)
{
Client.Notif("The RoomModel of this room is missing.", false);
ClearLoading(Client, true);
return;
}
if (!Room.BeginEnterRoom(Client, Password))
{
Client.GetUser().LeaveCurrentRoom();
ClearLoading(Client, false);
}
else
{
Client.GetUser().LeaveCurrentRoom();
Client.GetUser().PreparingRoomId = RoomId;
ContinueLoading(Client, null);
}
}
示例5: CreateRoom
private void CreateRoom(Client Client, Request Request)
{
int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;
if (RoomAmount >= Limit)
{
Client.Notif("You're over the rooms limit, first delete a room before you create a new one.", false);
return;
}
string RawName = Request.PopFixedString();
string RawModel = Request.PopFixedString();
int RoomId = -1;
if ((RoomId = BrickEngine.GetRoomReactor().CreateRoom(Client, RawName, RawModel)) > 0)
{
Response Response = new Response(59);
Response.AppendInt32(RoomId);
Response.AppendStringWithBreak(BrickEngine.CleanString(RawName));
Client.SendResponse(Response);
}
else
{
CheckRoomCreate(Client, null);
}
}
示例6: Interact
public void Interact(Client Commander, PetInfo Pet, string Command)
{
if (Interactions.ContainsKey(Command.ToLower()))
{
Interactions[Command.ToLower()].Invoke(Commander, Pet);
}
}
示例7: HandleCommand
public Boolean HandleCommand(string Command, Client Client, List<string> Params)
{
string Lowered = Command.ToLower();
foreach (KeyValuePair<KeyValuePair<string, string>, KeyValuePair<Handler, int>> kvp in Handlers)
{
if (kvp.Key.Key.ToLower().Equals(Command))
{
if (kvp.Value.Key != null && Client.GetUser().Rank >= kvp.Value.Value)
{
if (Client.GetUser().Rank >= kvp.Value.Value)
{
kvp.Value.Key.Invoke(Client, Params);
return true;
}
else
{
Client.Notif("You have no rights to do that command.", true);
return false;
}
}
}
}
return false;
}
示例8: AlertRoom
public void AlertRoom(Client Client, int RoomId, string Message, Boolean Warning)
{
if (Client.GetUser().Rank < 7)
{
Client.Notif("You need rank '7' to do this action.", false);
return;
}
if (BrickEngine.GetRoomReactor().RoomIsAlive(RoomId))
{
if (BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive).RoomUserAmount > 0)
{
foreach (VirtualRoomUser User in BrickEngine.GetRoomReactor().GetVirtualRoom(RoomId, Rooms.RoomRunningState.Alive).GetRoomEngine().GetUsers())
{
if (User.GetClient().GetUser().Rank > 1)
{
AlertUser(Client, User.HabboId, Message, false, false, true);
}
else
{
AlertUser(Client, User.HabboId, Message, Warning, false, true);
}
}
}
}
}
示例9: CompletedAchievement
public Boolean CompletedAchievement(Client Client)
{
if (Client.GetUser().Achievements.ContainsKey(Id))
{
return (Client.GetUser().Achievements[Id] >= MaxLevel);
}
return false;
}
示例10: AddUserTag
private void AddUserTag(Client Client, SiteRequest Request)
{
string Tag = Request.PopString();
if (!Client.GetUser().Tags.Contains(Tag))
{
Client.GetUser().Tags.Add(Tag);
}
}
示例11: CheckRoomCreate
private void CheckRoomCreate(Client Client, Request Request)
{
int Limit = BrickEngine.GetConfigureFile().CallIntKey("max.rooms.amount");
int RoomAmount = BrickEngine.GetRoomReactor().GetMe(Client.GetUser().HabboId).Count;
Response Response = new Response(512);
Response.AppendBoolean(RoomAmount >= Limit);
Response.AppendInt32(Limit);
Client.SendResponse(Response);
}
示例12: AddFriend
private void AddFriend(Client Client, SiteRequest Request)
{
int FriendId = Request.PopInt32();
if (FriendId <= 0 || FriendId == Request.GetUserId())
{
return;
}
BrickEngine.GetMessengerHandler().RequestUser(Request.GetUserId(), FriendId);
}
示例13: GetResponse
public void GetResponse(Client Client, Response Response)
{
Response.AppendInt32(Id);
Response.AppendBoolean((Client.GetUser().CurrentQuest.Equals(Id)) ? true : false);
Response.AppendStringWithBreak(FilterAction);
Response.AppendStringWithBreak(FilterParam);
Response.AppendInt32(PixelReward);
Response.AppendStringWithBreak(FilterReAction);
Response.AppendInt32((Client.GetUser().CurrentQuest.Equals(Id)) ? Client.GetUser().CurrentQuestProgress : 0);
Response.AppendInt32(ActionAmount);
}
示例14: AchievedCategory
public Boolean AchievedCategory(Client Client)
{
var AchievedQuests = Client.GetUser().Quests;
var CategoryQuests = BrickEngine.GetQuestReactor().OrderQuestsForCategory(Id);
if (AchievedQuests.ContainsKey(Id))
{
return AchievedQuests[Id] >= CategoryQuests.Count;
}
return false;
}
示例15: SocketClient
public SocketClient(SocketInformation Info)
: base(Info)
{
this.Client = new Client(this);
this.ArrayBuffer = new byte[ARRAY_BUFFER_SIZE];
base.Blocking = false;
ReceiveCallback = new AsyncCallback(EndReceiving);
SendCallback = new AsyncCallback(EndSending);
}