當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。