本文整理汇总了C#中Game.Server.GameObjects.GamePlayer类的典型用法代码示例。如果您正苦于以下问题:C# GamePlayer类的具体用法?C# GamePlayer怎么用?C# GamePlayer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GamePlayer类属于Game.Server.GameObjects命名空间,在下文中一共展示了GamePlayer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AASStateGet
public static int AASStateGet(GamePlayer player)
{
int userID = player.PlayerCharacter.ID;
bool result = true;
player.IsAASInfo = false;
player.IsMinor = true;
using (ProduceBussiness db = new ProduceBussiness())
{
String ID = db.GetASSInfoSingle(userID);
if (ID != "")
{
player.IsAASInfo = true;
result = false;
int Age = Convert.ToInt32(ID.Substring(6, 4));
int month = Convert.ToInt32(ID.Substring(10, 2));
if (DateTime.Now.Year.CompareTo(Age + 18) > 0 || (DateTime.Now.Year.CompareTo(Age + 18) == 0 && DateTime.Now.Month.CompareTo(month) >= 0))
player.IsMinor = false;
}
}
//int now= DateTime.Now.Month;
if (result && player.PlayerCharacter.IsFirst != 0 && player.PlayerCharacter.DayLoginCount < 1 && ISASSon)
{
player.Out.SendAASState(result);
}
//if (player.IsMinor || !player.IsAASInfo && ISASSon)
//{
player.Out.SendAASControl(AntiAddictionMgr.ISASSon, player.IsAASInfo, player.IsMinor);
//}
return 0;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:AntiAddictionMgr.cs
示例2: Execute
public void Execute(GamePlayer player, ItemInfo item)
{
//if (player.CurrentGame.Data.CurrentSpell != this)
if (player.CurrentGame.Data.CurrentFire == null)
{
player.CurrentGame.Data.CurrentSpell = this;
player.CurrentGame.Data.CurrentPorp = item;
//player.CurrentGame.Data.CurrentBall = Bussiness.Managers.BallMgr.FindBall(1);
player.CurrentGame.Data.SetCurrentBall(BallMgr.FindBall(1), false);
player.CurrentGame.Data.AddAttack = -1;
player.CurrentGame.Data.AddBall = 1;
}
else
{
if (player.CurrentGame.Data.Players[player].IsFrost == 0)
{
IceFronzeEffect ice = new IceFronzeEffect(item.Template.Property2);
ice.Start(player);
}
else
{
player.CurrentGame.Data.Players[player].SetFrost(item.Template.Property2);
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:27,代码来源:FrostSpell.cs
示例3: IsCompleted
public override bool IsCompleted(GamePlayer player)
{
bool result=false;
int tempComp=0;
using (ConsortiaBussiness db = new ConsortiaBussiness())
{
ConsortiaInfo info = db.GetConsortiaSingle(player.PlayerCharacter.ConsortiaID);
switch (m_info.Para1)
{
case 0: //公会人数
tempComp=info.Count;
break;
case 1: //公会贡献度
tempComp=player.PlayerCharacter.RichesOffer+player.PlayerCharacter.RichesRob;
break;
case 2: //公会铁匠铺等级
tempComp=info.SmithLevel;
break;
case 3: //公会商城等级
tempComp=info.ShopLevel;
break;
case 4: //公会保管箱等级
tempComp = info.StoreLevel;
break;
default:
break;
}
if (tempComp >= m_info.Para2)
{
Value = 0;
result=true;
}
return result;
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:35,代码来源:OwnConsortiaCondition.cs
示例4: RemovePlayer
/// <summary>
/// Removes a player from the scene.
/// </summary>
/// <param name="player"></param>
public void RemovePlayer(GamePlayer player)
{
_locker.AcquireWriterLock(Timeout.Infinite);
try
{
if (_players.ContainsKey(player.PlayerCharacter.ID))
_players.Remove(player.PlayerCharacter.ID);
}
finally
{
_locker.ReleaseWriterLock();
}
//通知客户端、场景用有人离开
GamePlayer[] list = GetAllPlayer();
GSPacketIn pkg = null;
foreach (GamePlayer p in list)
{
if (pkg == null)
{
pkg = p.Out.SendSceneRemovePlayer(player);
}
else
{
p.Out.SendTCP(pkg);
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:32,代码来源:Scene.cs
示例5: CommonBag
public CommonBag(GamePlayer player,int bagType)
: base(49, bagType)
{
_player = player;
_bagType = bagType;
_removedList = new List<ItemInfo>();
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:CommonPage.cs
示例6: HandleCommand
public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
//if (player.CurrentGame.Data.CurrentFire == player && player.CurrentGame.Data.ReduceFireBombs)
//{
// player.CurrentGame.ReturnPacket(player, packet);
// int id = packet.ReadInt();
// player.CurrentGame.Data.BlastID = id;
// player.CurrentGame.Data.BlastX = packet.ReadInt();
// player.CurrentGame.Data.BlastY = packet.ReadInt();
// FireBallInfo ballInfo = player.CurrentGame.Data.FireBall[id];
// ballInfo.EndTime = packet.ReadInt();
// if (player.CurrentGame.Data.BlastX > 0)
// {
// int space = ballInfo.GetSpace(player.CurrentGame.Data.BlastX, player.CurrentGame.Data.BlastY, ballInfo.EndTime);
// if (space > 20)
// {
// GameServer.log.Error("子弹爆炸错误,距离为:" + space.ToString());
// player.Client.Disconnect();
// return false;
// }
// }
// process.TankFire(player.CurrentGame, player, player.CurrentGame.Data.BlastX, player.CurrentGame.Data.BlastY, ballInfo);
//}
return true;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:30,代码来源:BlastCommand.cs
示例7: Start
public virtual void Start(GamePlayer player)
{
m_info.UserID = player.PlayerId;
m_info.IsExist = true;
m_player = player;
m_player.BufferList.AddBuffer(this);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:AbstractBuffer.cs
示例8: HandleCommand
public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
//if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.FRIST || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
if (player.CurrentGame.Data.CurrentIndex == player || player.CurrentGame.Data.Players[player].State == TankGameState.DEAD)
{
player.CurrentGame.ReturnPacket(player, packet);
player.CurrentGame.Data.Players[player].SetXY(packet.ReadInt(), packet.ReadInt());
//player.CurrentGame.Data.Players[player].StartMoving();
//GameServer.log.Error(string.Format("StopMoving {0} {1}",player.CurrentGame.Data.Players[player].X,player.CurrentGame.Data.Players[player].Y));
//由于同步问题,暂时去掉
//if (player.CurrentGame != null)
// player.CurrentGame.Data.Players[player].StartMoving();
// GameServer.log.Error(string.Format("StopMoving {0} {1}", player.CurrentGame.Data.Players[player].X, player.CurrentGame.Data.Players[player].Y));
return true;
}
else
{
//if (player.CurrentGame.Data.CurrentFire != null)
//{
//int x = packet.ReadInt();
//player.CurrentGame.Data.Players[player].PosY = packet.ReadInt();
//}
//return true;
}
return false;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:MoveStopCommand.cs
示例9: GetAnnex
public bool GetAnnex(string value, GamePlayer player, ref string msg, ref bool result, ref eMessageType eMsg)
{
int gid = int.Parse(value);
using (PlayerBussiness db = new PlayerBussiness())
{
ItemInfo goods = db.GetUserItemSingle(gid);
if (goods != null)
{
if (goods.TemplateID == 11408)
{
player.AddMedal(goods.Count);
return true;
}
else
{
if (player.AddItem(goods))
{
eMsg = eMessageType.Normal;
return true;
}
else
{
eMsg = eMessageType.ERROR;
result = false;
msg = LanguageMgr.GetTranslation(goods.GetBagName()) + LanguageMgr.GetTranslation("MailGetAttachHandler.NoPlace");
}
}
}
}
return false;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:31,代码来源:MailGetAttachHandler.cs
示例10: PlayerInventory
public PlayerInventory(GamePlayer player)
: base(60,0)
{
_player = player;
_removedList = new List<ItemInfo>();
//LoadFromDatabase(player.PlayerCharacter.ID);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:PlayerInventory.cs
示例11: BufferList
public BufferList(GamePlayer player)
{
m_player = player;
m_lock = new object();
m_buffers = new List<AbstractBuffer>();
m_clearList = new ArrayList();
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:BufferList.cs
示例12: CommonBag
public CommonBag(GamePlayer player,int bagType,int count)
: base(count, bagType, true)
{
_player = player;
_bagType = bagType;
_removedList = new List<ItemInfo>();
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:CommonPage.cs
示例13: OnPlayerStateChanged
public override void OnPlayerStateChanged(BaseSceneGame game, GamePlayer player)
{
base.OnPlayerStateChanged(game, player);
if (player.CurrentGameState == ePlayerGameState.FINISH && game.GameState == eGameState.LOAD)
CanStartGame(game);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:TankGameLogicProcessor.cs
示例14: Execute
public void Execute(GamePlayer player, ItemInfo item)
{
TankData data = player.CurrentGame.Data;
data.AddWound = (data.AddWound + (double)item.Template.Property2 / 100);
GSPacketIn pkg = player.Out.SendAddWound(player);
player.CurrentGame.SendToPlayerExceptSelf(pkg, player);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:8,代码来源:AddWoudSpell.cs
示例15: HandleCommand
public bool HandleCommand(TankHotSpringLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
if (player.CurrentHotSpringRoom != null)
{
}
return false;
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:8,代码来源:TimeUpdateCommand.cs
示例16: Execute
public void Execute(GamePlayer player, ItemInfo item)
{
TankData data = player.CurrentGame.Data;
data.AddMultiple = (1- (double)item.Template.Property2 / 100);
GSPacketIn pkg = player.Out.SendShootStraight(player);
player.CurrentGame.SendToPlayerExceptSelf(pkg, player);
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:8,代码来源:ShootStraightSpell.cs
示例17: AddToPlayer
/// <summary>
/// 添加监听
/// </summary>
/// <param name="player"></param>
public void AddToPlayer(GamePlayer player)
{
m_player = player;
if (m_data.IsComplete == false)
{
AddTrigger(player);
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:12,代码来源:BaseQuest.cs
示例18: QuestInventory
/// <summary>
/// 构造任务管理
/// </summary>
/// <param name="player"></param>
public QuestInventory(GamePlayer player)
{
m_converter = new System.Text.UnicodeEncoding();
m_player = player;
m_lock = new object();
m_list = new List<BaseQuest>();
m_clearList = new ArrayList();
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:12,代码来源:QuestInventory.cs
示例19: CreateRoomAction
public CreateRoomAction(GamePlayer player, String name, String password, eRoomType roomType, byte timeType)
{
m_player = player;
m_name = name;
m_password = password;
m_roomType = roomType;
m_timeType = timeType;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:8,代码来源:CreateRoomAction.cs
示例20: HandleCommand
public bool HandleCommand(TankGameLogicProcessor process, GamePlayer player, GSPacketIn packet)
{
//if (player.CurrentGame.Data.CurrentFire != null && player.CurrentGame.Data.CurrentIndex != player && !(player.CurrentGame.Data.Players[player].State == TankGameState.DEAD
// && player.CurrentTeamIndex == player.CurrentGame.Data.CurrentIndex.CurrentTeamIndex) && player.CanFly == false)
// return false;
if (player.CurrentGame.Data.CurrentFire != null )
return false;
if (player.CurrentGame.Data.CurrentIndex != player|| !player.CanFly)
return false;
player.CanFly = false;
GSPacketIn pkg = player.Out.SendPropUseRespone(player, -2, -2, CARRY_TEMPLATE_ID);
player.CurrentGame.SendToPlayerExceptSelf(pkg, player);
//构造一个CARRY Item
//ItemInfo CarryItem;
//using (ProduceBussiness db = new ProduceBussiness())
//{
// ItemTemplateInfo[] CarryTemplate = db.GetSingleCategory(10);
// foreach (ItemTemplateInfo tmp in CarryTemplate)
// {
// if (tmp.TemplateID == CARRY_TEMPLATE_ID)
// {
// CarryItem = ItemInfo.CreateFromTemplate(tmp, 1);
// if (CarryItem == null)
// {
// return false;
// }
// //if (player.CurrentGame.Data.CurrentIndex == player)
// // player.CurrentGame.Data.TotalDelay += CarryItem.Template.Property5;
// ISpellHandler spellHandler = SpellMgr.LoadSpellHandler(CarryItem.Template.Property1);
// spellHandler.Execute(player.CurrentGame.Data.CurrentIndex, CarryItem);
// return true;
// }
// }
//}
ItemTemplateInfo templateInfo = Managers.PropItemMgr.FindAllProp(CARRY_TEMPLATE_ID);
if (templateInfo != null)
{
ItemInfo CarryItem = ItemInfo.CreateFromTemplate(templateInfo, 1, (int)ItemAddType.TempProp);
ISpellHandler spellHandler = SpellMgr.LoadSpellHandler(CarryItem.Template.Property1);
spellHandler.Execute(player.CurrentGame.Data.CurrentIndex, CarryItem);
return true;
}
return false;
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:58,代码来源:FlyCommand.cs
注:本文中的Game.Server.GameObjects.GamePlayer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论