本文整理汇总了C#中Data.Structures.Player.Player类的典型用法代码示例。如果您正苦于以下问题:C# Player类的具体用法?C# Player怎么用?C# Player使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Player类属于Data.Structures.Player命名空间,在下文中一共展示了Player类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Start
public void Start(Player player)
{
if(!CanPlayerUseGather())
return;
StartGathering();
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:GatherableController.cs
示例2: SaveSkills
public void SaveSkills(Player player)
{
foreach (var skill in player.Skills)
{
SaveSkill(player, skill);
}
}
开发者ID:sdbezerra,项目名称:Temu,代码行数:7,代码来源:SkillsDAO.cs
示例3: ProcessRequest
public void ProcessRequest(int uid, bool isAccepted, Player arrivedFrom = null)
{
Request request;
lock (RequestsLock)
{
if (!WorldRequests.ContainsKey(uid))
return;
request = WorldRequests[uid];
request.InProgress = true;
}
// Someone tried to accept/decline request that don't belongs to him
if ((request.Target != null && request.Target != arrivedFrom)
|| (request.Target == null && !request.Owner.Party.PartyMembers.Contains(arrivedFrom)))
return;
IRequestAction action = null;
switch (request.Type)
{
case RequestType.PartyInvite:
action = new PartyAction(request);
break;
case RequestType.DuelInvite:
action = new DuelAction(request);
break;
case RequestType.GuildCreate:
action = new GuildAction(request, arrivedFrom);
break;
case RequestType.GuildInvite:
action = new GuildInviteAction(request);
break;
case RequestType.TradeStart:
action = new TradeAction(request);
break;
}
// process request
try
{
if(action == null)
return;
if (isAccepted)
action.Accepted();
else
action.Declined();
}
catch(Exception e)
{
Log.Error("Process request#{0} exception: {1}", (int)request.Type, e.ToString());
}
finally
{
// Ensure that we remove request, no matter what happens
if (!request.Blocking)
lock (RequestsLock)
UnregisterRequest(request);
}
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:60,代码来源:ActionEngine.cs
示例4: OnPlayerEnterWorld
public void OnPlayerEnterWorld(IConnection connection, Player player)
{
string uidHex = BitConverter.GetBytes(player.UID).ToHex()
+ BitConverter.GetBytes(ObjectFamily.Player.GetHashCode()).ToHex();
new SendPacket("8FCD00000000").Send(connection); //1725 EU
new SendPacket("0D9600000000").Send(connection); //1725 EU
//new SpFriendList(pState.Player.Friends).Send(connection);
//new SpFriendUpdate(pState.Player.Friends).Send(connection);
new SendPacket("A7F20000000000000000").Send(connection); //1725 EU
new SendPacket("03E70000000000000000").Send(connection); //1725 EU
new SpCharacterPosition(player).Send(connection);
FlyController flyController = player.Controller as FlyController;
if (flyController != null)
flyController.EndFly(player.Position.MapId);
new SendPacket("E1EB" + uidHex + "7CC4000001FFFFFF7F").Send(connection); //1725 EU
new SpCharacterStats(player).Send(connection);
new SpCharacterGatherstats(player.PlayerCraftStats).Send(connection);
CraftService.UpdateCraftRecipes(player);
player.LastOnlineUtc = Funcs.GetRoundedUtc();
}
开发者ID:Bozolika,项目名称:Eternal-Moon,代码行数:29,代码来源:FeedbackService.cs
示例5: PlayerDied
public void PlayerDied(Player player)
{
WorldPosition bindPoint = GetNearestBindPoint(player);
player.ClosestBindPoint = bindPoint;
Global.Global.VisibleService.Send(player, new SpCreatureDied(player));
}
开发者ID:mMellowz,项目名称:revcore,代码行数:7,代码来源:FeedbackService.cs
示例6: LoadQuest
public QuestData LoadQuest(Player player, int questId)
{
string cmdString = "SELECT * FROM questdata WHERE QuestId=?qid AND PlayerId=?pid";
MySqlCommand command = new MySqlCommand(cmdString, QuestDAOConnection);
command.Parameters.AddWithValue("?qid", questId);
command.Parameters.AddWithValue("?pid", player.Id);
MySqlDataReader reader = command.ExecuteReader();
QuestData quest = new QuestData(questId);
if (reader.HasRows)
{
while (reader.Read())
{
quest = new QuestData(questId)
{
QuestId = reader.GetInt32(1),
Status = (QuestStatus)Enum.Parse(typeof(QuestStatus), reader.GetString(2)),
Step = reader.GetInt32(3),
Counters = reader.GetString(4).Split(',').Select(n => int.Parse(n)).ToList()
};
}
}
reader.Close();
return quest;
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:26,代码来源:QuestDAO.cs
示例7: LoadQuest
public QuestData LoadQuest(Player player, int questid)
{
string SQL = "SELECT * FROM `quests` WHERE "
+ "`questid` = ?qid AND `characterid` = ?pid";
MySqlCommand cmd = new MySqlCommand(SQL, QuestDAOConnection);
cmd.Parameters.AddWithValue("?qid", questid);
cmd.Parameters.AddWithValue("?pid", player.Id);
MySqlDataReader LoadQuestReader = cmd.ExecuteReader();
QuestData quest = new QuestData(questid);
if (LoadQuestReader.HasRows)
{
while (LoadQuestReader.Read())
{
quest = new QuestData(questid)
{
QuestId = LoadQuestReader.GetInt32(1),
Status = (QuestStatus)Enum.Parse(typeof(QuestStatus), LoadQuestReader.GetString(2)),
Step = LoadQuestReader.GetInt32(3),
Counters = LoadQuestReader.GetString(4).Split(',').Select(n => int.Parse(n)).ToList()
};
}
}
LoadQuestReader.Close();
return quest;
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:27,代码来源:QuestDAO.cs
示例8: ApplyAbility
public void ApplyAbility(Player player)
{
foreach (var abi in player.Abilities.Values)
{
AddAbility(player, abi.Key, abi.Value);
}
}
开发者ID:mMellowz,项目名称:revcore,代码行数:7,代码来源:AbilityProcessor.cs
示例9: Cancel
public void Cancel(Player player)
{
lock (TradeLock)
{
if (IsTradeFinished())
return;
SystemMessages.OpponentCanceledTheTrade(player.PlayerData.Name).Send(Player1, Player2);
lock (Storage1.ItemsLock)
{
foreach (var item in Storage1.Items.Values)
Communication.Global.StorageService.AddItem(Player1, Player1.Inventory, item);
Player1.Inventory.Money += Storage1.Money;
}
lock (Storage2.ItemsLock)
{
foreach (var item in Storage2.Items.Values)
Communication.Global.StorageService.AddItem(Player2, Player2.Inventory, item);
Player2.Inventory.Money += Storage2.Money;
}
PreRelease();
Communication.Global.ControllerService.SetController(Player1, new DefaultController());
Communication.Global.ControllerService.SetController(Player2, new DefaultController());
PostRelease();
}
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:31,代码来源:PlayerTradeController.cs
示例10: GetParticipantMonsters
public override List<int> GetParticipantMonsters(Player player)
{
if (IsCountersComplete(player))
return new List<int>();
return new List<int>(Task.DroppedFrom);
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:QStepHuntingDelivery.cs
示例11: GetParticipantVillagers
public override List<int> GetParticipantVillagers(Player player)
{
if (!IsCountersComplete(player))
return new List<int>();
return new List<int> {Task.DeliverToFullId};
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:QStepHuntingDelivery.cs
示例12: SpTradeHideWindow
public SpTradeHideWindow(Player player1, Player player2, int tradeId, int type = 1)
{
Player1 = player1;
Player2 = player2;
TradeId = tradeId;
Type = type;
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:SpTradeHideWindow.cs
示例13: TrySetDefaultController
public void TrySetDefaultController(Player player)
{
if (player.Controller is DefaultController)
return;
SetController(player, new DefaultController());
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:ControllerService.cs
示例14: PlayerEndGame
public void PlayerEndGame(Player player)
{
//todo Maybe better create a callback in IController? smth like OnEndGame?
if(player.Controller is PlayerTradeController)
((PlayerTradeController)player.Controller).Cancel(player);
SetController(player, null);
}
开发者ID:ZettaZero,项目名称:TeraEmulator,代码行数:7,代码来源:ControllerService.cs
示例15: RemoveItem
public void RemoveItem(Player player, int slot, int count)
{
if (!(player.Controller is PlayerTradeController))
return;
((PlayerTradeController)player.Controller).RemoveItem(player, slot, count);
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:TradeService.cs
示例16: ProcessDamage
public void ProcessDamage(Player player)
{
if(player.Duel == null)
return;
player.Duel.LastKickUtc = Funcs.GetCurrentMilliseconds();
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:DuelService.cs
示例17: StartEmotion
public void StartEmotion(Player player, int emoteId)
{
player.CurrentEmotion = new KeyValuePair<int, int>(emoteId, (int)DateTime.Now.Ticks);
Communication.Global.VisibleService.Send(player, new SpCharacterEmotions(player, emoteId));
//TODO find emotions in SpCharacterInfo
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:EmotionService.cs
示例18: AddItem
public void AddItem(Player arrivedFrom, int slot, int count)
{
lock (TradeLock)
{
if (IsTradeFinished())
return;
// should be impossible, but it's better to check
if (arrivedFrom != Player1 && arrivedFrom != Player2)
return;
Storage storage = arrivedFrom.Equals(Player1) ? Storage1 : Storage2;
if (storage.Locked)
{
SystemMessages.TradeListLocked.Send(arrivedFrom);
return;
}
StorageItem item = Communication.Global.StorageService.GetItemBySlot(arrivedFrom.Inventory, slot + 20);
if (item == null)
return;
if (!Communication.Global.StorageService.AddItem(arrivedFrom, storage, item.ItemId, count))
return;
CheckLock(storage.Equals(Storage1) ? Storage2 : Storage1);
Communication.Global.StorageService.RemoveItem(arrivedFrom, arrivedFrom.Inventory, slot, count);
SystemMessages.YouAddedItemNameXItemAmountToTrade(item.ItemId, count).Send(arrivedFrom);
SystemMessages.OpponentAddedItemNameItemAmount(arrivedFrom.PlayerData.Name, item.ItemId, count).Send(
arrivedFrom.Equals(Player1) ? Player2 : Player1);
UpdateWindow();
}
}
开发者ID:r4ymonf,项目名称:TeraEmulator,代码行数:33,代码来源:PlayerTradeController.cs
示例19: AddQuests
public void AddQuests(Player player)
{
foreach (var quest in player.Quests.ToList())
{
AddQuest(player, quest.Value);
}
}
开发者ID:CadeLaRen,项目名称:TeraEmulator,代码行数:7,代码来源:QuestDAO.cs
示例20: AddMoney
public void AddMoney(Player arrivedFrom, long money)
{
lock (TradeLock)
{
if (IsTradeFinished())
return;
if (arrivedFrom != Player1 && arrivedFrom != Player2)
return;
Storage storage = arrivedFrom.Equals(Player1) ? Storage1 : Storage2;
if (storage.Locked)
{
SystemMessages.TradeListLocked.Send(arrivedFrom);
return;
}
if (!Communication.Global.StorageService.RemoveMoney(arrivedFrom, arrivedFrom.Inventory, money))
return;
Communication.Global.StorageService.AddMoneys(arrivedFrom, storage, money);
CheckLock(arrivedFrom.Equals(Player1) ? Storage2 : Storage1);
SystemMessages.YouOfferedMoney(storage.Money).Send(arrivedFrom);
SystemMessages.OpponentOfferedMoney(arrivedFrom.PlayerData.Name, storage.Money).Send(
arrivedFrom.Equals(Player1) ? Player2 : Player1);
UpdateWindow();
}
}
开发者ID:r4ymonf,项目名称:TeraEmulator,代码行数:29,代码来源:PlayerTradeController.cs
注:本文中的Data.Structures.Player.Player类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论