本文整理汇总了C#中Yupi.Game.GameClients.Interfaces.GameClient类的典型用法代码示例。如果您正苦于以下问题:C# GameClient类的具体用法?C# GameClient怎么用?C# GameClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameClient类属于Yupi.Game.GameClients.Interfaces命名空间,在下文中一共展示了GameClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override bool Execute(GameClient client, string[] pms)
{
ServerMessage message =
new ServerMessage(LibraryParser.OutgoingRequest("SuperNotificationMessageComposer"));
message.AppendString("Yupi");
message.AppendInteger(4);
message.AppendString("title");
message.AppendString("Yupi");
message.AppendString("message");
StringBuilder info = new StringBuilder();
info.Append("<h5><b>Yupi - Based on Azure Emulator</b><h5></br></br>");
info.Append("<br />");
info.AppendFormat(
"<b><br />Developed by:</b> <br />Kessiler Rodrigues (Kessiler)<br />Claudio Santoro (sant0ro/bi0s) <br />Rafael Oliveira (iPlezier) <br /><br /> ");
info.AppendFormat(
"<b>Thanks to:</b> <br />Jamal, Mike Santifort, Martinmine, Rockster, The old Azure Team, Bruna F., and to all people that uses Yupi.<br /> <br /> ");
info.AppendFormat("<b>Warning:</b><br />1. This emulator was planned to be used for ManiaHotel (maniahotel.com.br) <br />2. Please don't sell this emulator or earn money with it<br />3. All rights reserved to Sulake Corporation Oy<br />4. All Emulator rights for Mania Dev<br />");
message.AppendString(info.ToString());
message.AppendString("linkUrl");
message.AppendString("event:");
message.AppendString("linkTitle");
message.AppendString("ok");
client.SendMessage(message);
return true;
}
示例2: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (!hasRights)
return;
int num;
int.TryParse(item.ExtraData, out num);
switch (request)
{
case 1:
num++;
break;
case 2:
num--;
break;
case 3:
num = 0;
break;
}
item.ExtraData = num.ToString();
item.UpdateState(false, true);
}
示例3: SerializeQuest
/// <summary>
/// Serializes the quest.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="session">The session.</param>
/// <param name="quest">The quest.</param>
/// <param name="category">The category.</param>
internal static void SerializeQuest(ServerMessage message, GameClient session, Quest quest, string category)
{
if (message == null || session == null)
{
return;
}
var amountOfQuestsInCategory = Yupi.GetGame().GetQuestManager().GetAmountOfQuestsInCategory(category);
{
var num = quest == null ? amountOfQuestsInCategory : quest.Number - 1;
var num2 = quest == null ? 0 : session.GetHabbo().GetQuestProgress(quest.Id);
if (quest != null && quest.IsCompleted(num2))
{
num++;
}
message.AppendString(category);
message.AppendInteger(quest == null ? 0 : (quest.Category.Contains("xmas2012") ? 0 : num));
message.AppendInteger(quest == null
? 0
: (quest.Category.Contains("xmas2012") ? 0 : amountOfQuestsInCategory));
message.AppendInteger(quest?.RewardType ?? 3);
message.AppendInteger(quest?.Id ?? 0);
message.AppendBool(quest != null && session.GetHabbo().CurrentQuestId == quest.Id);
message.AppendString(quest == null ? string.Empty : quest.ActionName);
message.AppendString(quest == null ? string.Empty : quest.DataBit);
message.AppendInteger(quest?.Reward ?? 0);
message.AppendString(quest == null ? string.Empty : quest.Name);
message.AppendInteger(num2);
message.AppendInteger(quest?.GoalData ?? 0u);
message.AppendInteger(quest?.TimeUnlock ?? 0);
message.AppendString(string.Empty);
message.AppendString(string.Empty);
message.AppendBool(true);
}
}
示例4: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient client = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (client == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
uint amount;
if (!uint.TryParse(pms[1], out amount))
{
session.SendWhisper(Yupi.GetLanguage().GetVar("enter_numbers"));
return true;
}
client.GetHabbo().Diamonds += amount;
client.GetHabbo().UpdateSeasonalCurrencyBalance();
client.SendNotif(string.Format(Yupi.GetLanguage().GetVar("staff_gives_diamonds"), session.GetHabbo().UserName, amount));
return true;
}
示例5: OnTrigger
public override void OnTrigger(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 (user.Coordinate != item.SquareInFront && user.CanWalk)
{
user.MoveTo(item.SquareInFront);
return;
}
if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride))
return;
if (item.InteractingUser == 0)
{
item.InteractingUser = user.HabboId;
user.CanWalk = false;
if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y))
user.ClearMovement();
user.AllowOverride = true;
user.MoveTo(item.Coordinate);
item.ReqUpdate(4, true);
}
}
示例6: Execute
public override bool Execute(GameClient session, string[] pms)
{
Yupi.GetGame().GetHallOfFame().RefreshHallOfFame();
Yupi.GetGame().GetRoomManager().GetCompetitionManager().RefreshCompetitions();
Yupi.GetGame().GetTargetedOfferManager().LoadOffer();
return true;
}
示例7: Execute
public override bool Execute(GameClient session, string[] pms)
{
uint amount;
if (!uint.TryParse(pms[0], out amount))
{
session.SendNotif(Yupi.GetLanguage().GetVar("enter_numbers"));
return true;
}
foreach (GameClient client in Yupi.GetGame().GetClientManager().Clients.Values)
{
if (client?.GetHabbo() == null)
continue;
Habbo habbo = client.GetHabbo();
habbo.Diamonds += amount;
client.GetHabbo().UpdateSeasonalCurrencyBalance();
client.SendNotif(Yupi.GetLanguage().GetVar("command_diamonds_one_give") + amount + Yupi.GetLanguage().GetVar("command_diamonds_two_give"));
}
return true;
}
示例8: Execute
public override bool Execute(GameClient session, string[] pms)
{
PetTypeManager.Load();
PetCommandHandler.Init(Yupi.GetDatabaseManager().GetQueryReactor());
return true;
}
示例9: Execute
public override bool Execute(GameClient session, string[] pms)
{
GameClient user = Yupi.GetGame().GetClientManager().GetClientByUserName(pms[0]);
if (user == null)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_not_found"));
return true;
}
if (user.GetHabbo().Rank >= session.GetHabbo().Rank)
{
session.SendWhisper(Yupi.GetLanguage().GetVar("user_is_higher_rank"));
return true;
}
try
{
Yupi.GetGame()
.GetBanManager()
.BanUser(user, session.GetHabbo().UserName, 788922000.0, string.Join(" ", pms.Skip(2)),
true, false);
}
catch
{
ServerLogManager.LogException($"An error occurred when {session.GetHabbo().UserName} tried to ban {user.GetHabbo().UserName}");
}
return true;
}
示例10: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
RoomUser roomUser = null;
if (session != null)
roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUser == null)
return;
if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
{
if (item.ExtraData == "-1")
return;
if (request == -1)
{
item.ExtraData = "0";
item.UpdateState();
return;
}
item.ExtraData = "-1";
item.UpdateState(false, true);
item.ReqUpdate(4, true);
return;
}
roomUser.MoveTo(item.SquareInFront);
}
示例11: OnPlace
public override void OnPlace(GameClient session, RoomItem item)
{
item.GetRoom().GetRoomItemHandler().HopperCount++;
using (IQueryAdapter queryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
{
queryReactor.SetQuery("INSERT INTO items_hopper (hopper_id, room_id) VALUES (@hopperid, @roomid);");
queryReactor.AddParameter("hopperid", item.Id);
queryReactor.AddParameter("roomid", item.RoomId);
queryReactor.RunQuery();
}
if (item.InteractingUser == 0u)
return;
RoomUser roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(item.InteractingUser);
if (roomUserByHabbo != null)
{
roomUserByHabbo.ClearMovement();
roomUserByHabbo.AllowOverride = false;
roomUserByHabbo.CanWalk = true;
}
item.InteractingUser = 0u;
}
示例12: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (!hasRights)
return;
int num;
int.TryParse(item.ExtraData, out num);
switch (request)
{
case 1:
if (item.PendingReset && num > 0)
{
num = 0;
item.PendingReset = false;
}
else
{
num += 60;
item.UpdateNeeded = false;
}
break;
case 2:
item.UpdateNeeded = !item.UpdateNeeded;
item.PendingReset = true;
break;
}
item.ExtraData = num.ToString();
item.UpdateState();
}
示例13: Execute
public override bool Execute(GameClient session, string[] pms)
{
session.GetHabbo().GetInventoryComponent().Redeemcredits(session);
session.SendNotif(Yupi.GetLanguage().GetVar("command_redeem_credits"));
return true;
}
示例14: Execute
public override bool Execute(GameClient session, string[] pms)
{
session.GetHabbo().SpectatorMode = true;
session.SendNotif("In next room you enter you will be invisible.");
return true;
}
示例15: HelperSession
/// <summary>
/// Initializes a new instance of the <see cref="HelperSession" /> class.
/// </summary>
/// <param name="helper">The helper.</param>
/// <param name="requester">The requester.</param>
/// <param name="question">The question.</param>
internal HelperSession(GameClient helper, GameClient requester, string question)
{
Helper = helper;
Requester = requester;
Chats = new List<string> {question};
Response(requester, question);
}