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


C# Network.Client类代码示例

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


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

示例1: AddNewClass

 public static void AddNewClass(Client client, string ClassName)
 {
     if (System.IO.File.Exists(GetTempFolder(client) + ClassName + ".cs") == false) {
         System.IO.File.WriteAllText(GetTempFolder(client) + ClassName + ".cs", "using Server;\nusing Server.Scripting;\nusing Server.Database;\nusing System;\nusing System.Drawing;\nusing System.Xml;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Forms;\n\nnamespace Script \n{\npublic class " + ClassName + "\n{\n\n}\n}");
         Messenger.SendDataTo(client, TcpPacket.CreatePacket("scriptfiledata", ClassName, GetScriptFile(client, ClassName)));
     }
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:7,代码来源:EditorHelper.cs

示例2: CheckPlayerLevelUp

        public static void CheckPlayerLevelUp(PacketHitList hitList, Client client)
        {
            PacketHitList.MethodStart(ref hitList);
            if (client.Player.GetActiveRecruit().Exp > client.Player.GetActiveRecruit().GetNextLevel()) {
                if (client.Player.GetActiveRecruit().Level < Exp.ExpManager.Exp.MaxLevels) {
                    Scripting.ScriptManager.InvokeSub("PlayerLevelUp", hitList, client);

                    hitList.AddPacketToMap(client.Player.Map, TcpPacket.CreatePacket("levelup", client.ConnectionID.ToString()));
                    //Messenger.SendDataToMap(client.Player.MapID, TcpPacket.CreatePacket("levelup", client.ConnectionID.ToString()));
                }

                if (client.Player.GetActiveRecruit().Level >= Exp.ExpManager.Exp.MaxLevels) {
                    client.Player.GetActiveRecruit().Level = Exp.ExpManager.Exp.MaxLevels;
                    client.Player.GetActiveRecruit().Exp = ExpManager.Exp[Exp.ExpManager.Exp.MaxLevels - 1];
                }
            } else {
                PacketBuilder.AppendEXP(client, hitList);
                //Messenger.SendEXP(client);
            }

            PacketHitList.MethodEnded(ref hitList);

            //Messenger.SendActiveTeam(index);

            //Messenger.SendHP(index);
            //Messenger.SendStats(index);
            //Messenger.BattleMsg(index, "You.", Text.BrightBlue);
        }
开发者ID:pzaps,项目名称:Server,代码行数:28,代码来源:BattleProcessor.cs

示例3: ResumeStory

 internal static void ResumeStory(Client client, int storyNum)
 {
     client.Player.LoadingStory = true;
     Messenger.SendLoadingStoryTo(client);
     client.Player.CurrentChapter = Stories[storyNum];
     Messenger.SendDataTo(client, TcpPacket.CreatePacket("storycheck", storyNum.ToString(), Stories[storyNum].Revision.ToString()));
 }
开发者ID:pzaps,项目名称:Server,代码行数:7,代码来源:StoryManager.cs

示例4: AppendFileListToPacket

 public static void AppendFileListToPacket(Client client, TcpPacket packet)
 {
     string[] files = System.IO.Directory.GetFiles(GetTempFolder(client));
     packet.AppendParameter(files.Length.ToString());
     for (int i = 0; i < files.Length; i++) {
         packet.AppendParameter(System.IO.Path.GetFileNameWithoutExtension(files[i]));
     }
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:8,代码来源:EditorHelper.cs

示例5: FindAllEvolutions

        public static List<int> FindAllEvolutions(Client client, int evoIndex)
        {
            List<int> evoToLoad = new List<int>();

            for (int i = 0; i < Evolutions[evoIndex].Branches.Count; i++) {
                evoToLoad.Add(i);
            }
            return evoToLoad;
        }
开发者ID:pzaps,项目名称:Server,代码行数:9,代码来源:EvolutionManager.cs

示例6: CanAddToParty

 public bool CanAddToParty(Client client)
 {
     // If there are less than 4 members
     if (Members.Count < 4) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:pzaps,项目名称:Server,代码行数:9,代码来源:Party.cs

示例7: ContainsClient

 public static bool ContainsClient(Client client)
 {
     rwLock.EnterReadLock();
     try {
         return clients.ContainsValue(client);
     } finally {
         rwLock.ExitReadLock();
     }
 }
开发者ID:pzaps,项目名称:Server,代码行数:9,代码来源:ClientManager.cs

示例8: RunScript

 public static void RunScript(Client client, int script, string param1, string param2, string param3, bool wait)
 {
     if (wait) {
         ScriptManager.InvokeSub("StoryScript", client, script, param1, param2, param3, wait);
         Messenger.SendDataTo(client, TcpPacket.CreatePacket("storyscriptcomplete"));
     } else {
         Messenger.SendDataTo(client, TcpPacket.CreatePacket("storyscriptcomplete"));
         ScriptManager.InvokeSub("StoryScript", client, script, param1, param2, param3, wait);
     }
 }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:StoryManager.cs

示例9: SaveScript

 public static void SaveScript(Client client)
 {
     foreach (string File in System.IO.Directory.GetFiles(IO.Paths.ScriptsFolder, "*.cs", System.IO.SearchOption.TopDirectoryOnly)) {
         System.IO.File.Delete(File);
     }
     foreach (string File in System.IO.Directory.GetFiles(GetTempFolder(client))) {
         //IO.File.Delete(ScriptFolder & Path.GetFileNameWithoutExtension(File) & ".txt")
         System.IO.File.Copy(File, IO.Paths.ScriptsFolder + System.IO.Path.GetFileNameWithoutExtension(File) + ".cs", true);
     }
 }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:EditorHelper.cs

示例10: MapLoadTriggerEvent

 public MapLoadTriggerEvent(string id, TriggerEventAction action, int triggerCommand, bool autoRemove,
     Client client, string mapID)
 {
     this.id = id;
     this.action = action;
     this.triggerCommand = triggerCommand;
     this.autoRemove = autoRemove;
     this.client = client;
     this.mapID = mapID;
 }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:MapLoadTriggerEvent.cs

示例11: Add

 public bool Add(Client client)
 {
     if (CanAddToParty(client)) {
         Add(client.Player.CharID);
         SwitchOutExtraMembers();
         return true;
     } else {
         return false;
     }
 }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:PartyMemberCollection.cs

示例12: PlayerEventThread

        public PlayerEventThread(Client ownerClient)
        {
            playerThread = new Thread(new ThreadStart(ProcessQueuedEvents));
            resetEvent = new ManualResetEvent(false);
            eventQueue = new PlayerEventQueue();
            this.ownerClient = ownerClient;

            playerThread.IsBackground = true;
            playerThread.Start();
        }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:PlayerEventThread.cs

示例13: Party

        public Party(string partyID, Client leader)
        {
            PartyID = partyID;

            Members = new List<string>();
            Members.Add(leader.Player.CharID);
            using (DatabaseConnection dbConnection = new DatabaseConnection(DatabaseID.Players)) {
                PartyManager.SaveParty(dbConnection.Database, this);
            }
        }
开发者ID:pzaps,项目名称:Server,代码行数:10,代码来源:Party.cs

示例14: InitTempScript

 public static void InitTempScript(Client client)
 {
     if (System.IO.Directory.Exists(GetTempFolder(client)) == true) {
         System.IO.Directory.Delete(GetTempFolder(client), true);
     }
     System.IO.Directory.CreateDirectory(GetTempFolder(client));
     string[] files = System.IO.Directory.GetFiles(IO.Paths.ScriptsFolder, "*.cs", System.IO.SearchOption.TopDirectoryOnly);
     for (int i = 0; i < files.Length; i++) {
         System.IO.File.Copy(files[i], GetTempFolder(client) + System.IO.Path.GetFileNameWithoutExtension(files[i]) + ".cs");
     }
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:11,代码来源:EditorHelper.cs

示例15: MoveNpcDown

 public static bool MoveNpcDown(IMap map, Client target, PacketHitList packetList, int mapNpcSlot)
 {
     // Down
     if (map.ActiveNpc[mapNpcSlot].Y < target.Player.Y) {
         if (MovementProcessor.CanNpcMove(map, mapNpcSlot, Enums.Direction.Down)) {
             MovementProcessor.NpcMove(packetList, map, mapNpcSlot, map.ActiveNpc[mapNpcSlot].Direction, Enums.Speed.Walking);
             return true;
         }
     }
     return false;
 }
开发者ID:ScruffyKnight,项目名称:PMU-Server,代码行数:11,代码来源:AIProcessor.cs


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