当前位置: 首页>>代码示例>>C#>>正文


C# Clients.WorldClient类代码示例

本文整理汇总了C#中Symbioz.Network.Clients.WorldClient的典型用法代码示例。如果您正苦于以下问题:C# WorldClient类的具体用法?C# WorldClient怎么用?C# WorldClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WorldClient类属于Symbioz.Network.Clients命名空间,在下文中一共展示了WorldClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleEffects

 public static bool HandleEffects(WorldClient client, CharacterItemRecord item)
 {
     bool remove = false;
     if (!ConditionProvider.ParseAndEvaluate(client,item.GetTemplate().Criteria))
     {
         client.Character.Reply("Vous ne possédez pas les critères nécessaires pour utiliser cet objet.");
         return remove;
     }
     var effects = item.GetEffects();
     foreach (var effect in effects)
     {
         var function = Functions.ToList().Find(x => x.Key == (EffectsEnum)effect.actionId);
         if (function.Value != null)
         {
             try
             {
                 if (function.Value(client, effect, item.UID))
                     remove = true;
             }
             catch (Exception ex)
             {
                 client.Character.NotificationError(ex.Message);
             }
         }
         else
         {
             client.Character.NotificationError((EffectsEnum)effect.actionId + " is not handled");
         }
     }
     return remove;
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:31,代码来源:ItemUseEffectsProvider.cs

示例2: HandleAttackRequest

        public static void HandleAttackRequest(GameRolePlayAttackMonsterRequestMessage message, WorldClient client)
        {
            if (client.Character.Map == null)
                return;
            if (client.Character.CancelMonsterAgression)
            {
                client.Character.CancelMonsterAgression = false;
                return;
            }
            if (!client.Character.Map.IsValid())
            {
                client.Character.Reply("Unable to start placement,this map is not valid");
                return;
            }
            var group = client.Character.Map.Instance.GetMapMonsterGroup(message.monsterGroupId);
            if (group != null)
            {
                FightPvM fight = FightProvider.Instance.CreatePvMFight(group, client.Character.Map, (short)group.CellId);

                fight.BlueTeam.AddFighter(client.Character.CreateFighter(fight.BlueTeam)); // on ajoute le perso

                group.Monsters.ForEach(x => fight.RedTeam.AddFighter(x.CreateFighter(fight.RedTeam))); // on ajoute les monstres

                fight.StartPlacement();
            }
            else
            {
                client.Character.NotificationError("Unable to fight, MonsterGroup dosent exist...");
            }
        }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:30,代码来源:FightPreparationHandler.cs

示例3: HandleShortcutBarAdd

        public static void HandleShortcutBarAdd(ShortcutBarAddRequestMessage message, WorldClient client)
        {
            switch ((ShortcutBarEnum)message.barType)
            {
                case ShortcutBarEnum.GENERAL_SHORTCUT_BAR:
                    if (message.shortcut is ShortcutObjectItem)
                    {
                        ShortcutObjectItem shortcutObj = (ShortcutObjectItem)message.shortcut;
                        GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutObj.slot, ShortcutObjectItem.Id, shortcutObj.itemUID, shortcutObj.itemGID);
                    }
                    if (message.shortcut is ShortcutSmiley)
                    {
                        ShortcutSmiley shortcutSmiley = (ShortcutSmiley)message.shortcut;
                        GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutSmiley.slot, ShortcutSmiley.Id, shortcutSmiley.smileyId, 0);
                    }
                    if (message.shortcut is ShortcutEmote)
                    {
                        ShortcutEmote shortcutEmote = (ShortcutEmote)message.shortcut;
                        GeneralShortcutRecord.AddShortcut(client.Character.Id, shortcutEmote.slot, ShortcutEmote.Id, shortcutEmote.emoteId, 0);
                    }
                    break;

                case ShortcutBarEnum.SPELL_SHORTCUT_BAR:
                    ShortcutSpell shortcut = (ShortcutSpell)message.shortcut;
                    SpellShortcutRecord.AddShortcut(client.Character.Id, shortcut.slot, shortcut.spellId);
                    break;
            }
            client.Character.RefreshShortcuts();
        }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:29,代码来源:ContextRolePlayHandler.cs

示例4: HandleAllianceKickRequest

 public static void HandleAllianceKickRequest(AllianceKickRequestMessage message, WorldClient client)
 {
     if(client.Character.HasAlliance && AllianceProvider.GetLeader(client.Character.AllianceId).Id == client.Character.GuildId && GuildProvider.GetLeader(client.Character.GuildId).CharacterId == client.Character.Id)
     {
         AllianceRecord.GetAlliance(client.Character.AllianceId).KickFromAlliance((int)message.kickedId, client);
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:7,代码来源:AllianceHandler.cs

示例5: Eval

 public override bool Eval(WorldClient client)
 {
     if (client.Character.Record.Breed == sbyte.Parse(ConditionValue))
         return true;
     else
         return false;
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:7,代码来源:BreedCondition.cs

示例6: HandlePartyInvitationDungeonRequest

 public static void HandlePartyInvitationDungeonRequest(PartyInvitationDungeonRequestMessage message, WorldClient client)
 {
     WorldClient target = WorldServer.Instance.GetOnlineClient(message.name);
     Party p;
     if (client.Character.PartyMember == null)
     {
         WorldServer.Instance.Parties.OrderBy(x => x.Id);
         int partyId = 0;
         if (WorldServer.Instance.Parties.Count > 0)
         {
             partyId = WorldServer.Instance.Parties.Last().Id + 1;
         }
         else
         {
             partyId = 1;
         }
         p = new Party(partyId, client.Character.Id, "");
     }
     else
     {
         p = WorldServer.Instance.Parties.Find(x => x.Id == client.Character.PartyMember.Party.Id);
     }
     if (p == null)
         return;
     p.SetName(DungeonsIdRecord.DungeonsId.Find(x => x.Id == message.dungeonId).Name, client);
     p.CreateInvitation(client, target, PartyTypeEnum.PARTY_TYPE_DUNGEON, message.dungeonId);
     if (p.Members.Count == 0)
     {
         p.BossCharacterId = client.Character.Id;
         p.NewMember(client);
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:32,代码来源:PartyHandler.cs

示例7: HandleChallengeAnswer

        public static void HandleChallengeAnswer(GameRolePlayPlayerFightFriendlyAnswerMessage message, WorldClient client)
        {
            if (client.Character.IsFighting)
                return;
            FightDual fight = FightProvider.Instance.GetFight(message.fightId) as FightDual;
            var sMessage = new GameRolePlayPlayerFightFriendlyAnsweredMessage(message.fightId, (uint)client.Character.Id, (uint)fight.InitiatorId, false);

            if (client.Character.Id == fight.InitiatorId)
            {
                var acceptor = WorldServer.Instance.GetOnlineClient(fight.AcceptorId);
                acceptor.Send(sMessage);
                return;
            }
            WorldClient target = WorldServer.Instance.GetOnlineClient((fight.InitiatorId));
            if (message.accept)
            {

                sMessage.accept = true;
                target.Send(sMessage);
                fight.BlueTeam.AddFighter(client.Character.CreateFighter(fight.BlueTeam));
                fight.RedTeam.AddFighter(target.Character.CreateFighter(fight.RedTeam));
                fight.StartPlacement();
            }
            else
            {
                target.Send(sMessage);
                FightProvider.Instance.RemoveFight(message.fightId);
            }
        }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:29,代码来源:FightPreparationHandler.cs

示例8: GuildInvitationDialog

 public GuildInvitationDialog(WorldClient recruter, WorldClient recruted)
 {
     this.Recruter = recruter;
     this.Recruted = recruted;
     this.Recruter.Character.GuildInvitationDialog = this;
     this.Recruted.Character.GuildInvitationDialog = this;
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:7,代码来源:GuildInvitationDialog.cs

示例9: HandleAllianceCreationRequest

        public static void HandleAllianceCreationRequest(AllianceCreationValidMessage message, WorldClient client)
        {
            if (!AllianceProvider.CanCreateAlliance(client, message))
                return;

            client.Send(new AllianceCreationResultMessage((sbyte)GuildCreationResultEnum.GUILD_CREATE_OK));
            AllianceProvider.CreateAlliance(client.Character.GetGuild(), message.allianceTag, message.allianceName, message.allianceEmblem);
        }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:8,代码来源:AllianceHandler.cs

示例10: Eval

 public override bool Eval(WorldClient client)
 {
     if (client.Character.HasGuild)
     {
         return true;
     }
     return false;
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:8,代码来源:GuildsCondition.cs

示例11: HandleObjectUseMultiple

 public static void HandleObjectUseMultiple(ObjectUseMultipleMessage message, WorldClient client)
 {
     var item = client.Character.Inventory.GetItem(message.objectUID);
     for (int i = 0; i < message.quantity; i++)
     {
         ItemUseEffectsProvider.HandleEffects(client, item);
     }
     client.Character.Inventory.RemoveItem(item.UID, message.quantity);
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:9,代码来源:InventoryHandler.cs

示例12: PlayerTradeExchange

 public PlayerTradeExchange(WorldClient client, WorldClient target)
 {
     this.Client = client;
     this.SecondTrader = target;
     this.SecondTrader.Character.CurrentDialogType = DialogTypeEnum.DIALOG_EXCHANGE;
     this.Client.Character.CurrentDialogType = DialogTypeEnum.DIALOG_EXCHANGE;
     this.Client.Character.ExchangeType = ExchangeType;
     this.SecondTrader.Character.ExchangeType = ExchangeType;
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:9,代码来源:PlayerTradeExchange.cs

示例13: HandleDungeonPartyFinder

 public static void HandleDungeonPartyFinder(DungeonPartyFinderAvailableDungeonsRequestMessage message, WorldClient client)
 {
     List<DungeonsIdRecord> record = DungeonsIdRecord.DungeonsId;
     List<ushort> ids = new List<ushort>();
     foreach(DungeonsIdRecord dj in record)
     {
         ids.Add((ushort)dj.Id);
     }
     client.Send(new DungeonPartyFinderAvailableDungeonsMessage((IEnumerable<ushort>)ids));
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:10,代码来源:PartyHandler.cs

示例14: Character

        public Character(CharacterRecord record, WorldClient client)
        {
            this.Client = client;
            this.Record = record;
            this.Look = ContextActorLook.Parse(Record.Look);
            this.HumanOptions = new List<HumanOption>();

            this.Inventory = new Inventory(this);

            this.PlayerStatus = new PlayerStatus((sbyte)PlayerStatusEnum.PLAYER_STATUS_AVAILABLE);
        }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:11,代码来源:Character.cs

示例15: HandleGuildChangeMemberParameters

 public static void HandleGuildChangeMemberParameters(GuildChangeMemberParametersMessage message, WorldClient client)
 {
     CharacterGuildRecord member = CharacterGuildRecord.GetCharacterGuild((int)message.memberId);
     member.ChangeParameters(client, message.rank, message.experienceGivenPercent, message.rights);
     SendGuildInformationsMembers(client);
     if (WorldServer.Instance.IsConnected(member.CharacterId))
     {
         WorldClient c = WorldServer.Instance.GetOnlineClient(member.CharacterId);
         c.Send(new GuildMembershipMessage(c.Character.GetGuild().GetGuildInformations(),message.rights,true));
     }
 }
开发者ID:thomasvinot,项目名称:Symbioz,代码行数:11,代码来源:GuildHandler.cs


注:本文中的Symbioz.Network.Clients.WorldClient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。