sm

立即登录 | 账号注册

积分: 0 |用户组: 游客

搜索
服务器租用 传奇3一条龙 支付平台源码 无法下载点击此处反馈
查看: 1461|回复: 5

[传奇3源码] 传奇3G2005源代码C# 逆向Zircon传奇3G源码

[复制链接]

826

主题

36

回帖

23万

积分

霸王教主

积分
235297
发表于 2023-4-6 00:15:57 | 显示全部楼层 |阅读模式
  1. using Client.Controls;
  2. using Client.Envir.Translations;
  3. using Client.Models;
  4. using Client.Scenes;
  5. using Client.Scenes.Views;
  6. using Client.UserModels;
  7. using Library;
  8. using Library.MirDB;
  9. using Library.Network;
  10. using Library.SystemModels;
  11. using MirDB;
  12. using SlimDX;
  13. using SlimDX.Direct3D9;
  14. using System;
  15. using System.Collections.Concurrent;
  16. using System.Collections.Generic;
  17. using System.Drawing;
  18. using System.IO;
  19. using System.Linq;
  20. using System.Threading;
  21. using System.Threading.Tasks;
  22. using System.Windows.Forms;

  23. namespace Client.Envir
  24. {
  25.   public static class CEnvir
  26.   {
  27.     public static TargetForm Target;
  28.     public static Random Random = new Random();
  29.     private static DateTime _FPSTime;
  30.     private static int FPSCounter;
  31.     private static int FPSCount;
  32.     public static int DPSCounter;
  33.     private static int DPSCount;
  34.     public static bool Shift;
  35.     public static bool Alt;
  36.     public static bool Ctrl;
  37.     public static DateTime Now;
  38.     public static Point MouseLocation;
  39.     public static CConnection Connection;
  40.     public static bool WrongVersion;
  41.     public static Dictionary<LibraryFile, MirLibrary> LibraryList = new Dictionary<LibraryFile, MirLibrary>();
  42.     public static ClientUserItem[] Storage;
  43.     public static ClientUserItem[] MainStorage;
  44.     public static List<ClientBlockInfo> BlockList = new List<ClientBlockInfo>();
  45.     public static DBCollection<KeyBindInfo> KeyBinds;
  46.     public static DBCollection<WindowSetting> WindowSettings;
  47.     public static DBCollection<CastleInfo> CastleInfoList;
  48.     public static Session Session;
  49.     public static ConcurrentQueue<string> ChatLog = new ConcurrentQueue<string>();
  50.     public static bool Loaded;
  51.     public static string BuyAddress;
  52.     public static string C;
  53.     public static bool TestServer;
  54.     public static int ErrorCount;
  55.     private static string LastError;

  56.     public static StringMessages Language { get; set; }

  57.     static CEnvir()
  58.     {
  59.       new Thread(new ThreadStart(CEnvir.SaveChatLoop))
  60.       {
  61.         IsBackground = true
  62.       }.Start();
  63.       try
  64.       {
  65.         CEnvir.A();
  66.       }
  67.       catch
  68.       {
  69.       }
  70.     }

  71.     public static void LoadLanguage()
  72.     {
  73.       string upper = Config.Language.ToUpper();
  74.       if (!(upper == "ENGLISH"))
  75.       {
  76.         if (!(upper == "CHINESE"))
  77.           return;
  78.         CEnvir.Language = (StringMessages) ((Dictionary<System.Type, object>) ConfigReader.ConfigObjects)[typeof (ChineseMessages)];
  79.       }
  80.       else
  81.         CEnvir.Language = (StringMessages) ((Dictionary<System.Type, object>) ConfigReader.ConfigObjects)[typeof (EnglishMessages)];
  82.     }

  83.     private static void A()
  84.     {
  85.       string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "My Games", "Zircon");
  86.       if (!Directory.Exists(path))
  87.         Directory.CreateDirectory(path);
  88.       if (File.Exists(path + "\\CheckSum.bin"))
  89.       {
  90.         using (BinaryReader binaryReader = new BinaryReader((Stream) File.OpenRead(path + "\\CheckSum.bin")))
  91.           CEnvir.C = binaryReader.ReadString();
  92.       }
  93.       else
  94.       {
  95.         using (BinaryWriter binaryWriter = new BinaryWriter((Stream) File.Create(path + "\\CheckSum.bin")))
  96.           binaryWriter.Write(CEnvir.C = Functions.RandomString(CEnvir.Random, 20));
  97.       }
  98.     }

  99.     public static void SaveChatLoop()
  100.     {
  101.       List<string> stringList = new List<string>();
  102.       while (true)
  103.       {
  104.         while (CEnvir.ChatLog.IsEmpty)
  105.           Thread.Sleep(1000);
  106.         while (!CEnvir.ChatLog.IsEmpty)
  107.         {
  108.           string result;
  109.           if (CEnvir.ChatLog.TryDequeue(out result))
  110.             stringList.Add(result);
  111.         }
  112.         try
  113.         {
  114.           File.AppendAllLines(".\\Chat Logs.txt", (IEnumerable<string>) stringList);
  115.           stringList.Clear();
  116.         }
  117.         catch
  118.         {
  119.         }
  120.       }
  121.     }

  122.     public static void GameLoop()
  123.     {
  124.       CEnvir.UpdateGame();
  125.       CEnvir.RenderGame();
  126.       if (!Config.LimitFPS)
  127.         return;
  128.       Thread.Sleep(1);
  129.     }

  130.     private static void UpdateGame()
  131.     {
  132.       CEnvir.Now = Time.get_Now();
  133.       DXControl.ActiveScene?.OnMouseMove(new MouseEventArgs(MouseButtons.None, 0, CEnvir.MouseLocation.X, CEnvir.MouseLocation.Y, 0));
  134.       if (Time.get_Now() >= CEnvir._FPSTime)
  135.       {
  136.         CEnvir._FPSTime = Time.get_Now().AddSeconds(1.0);
  137.         CEnvir.FPSCount = CEnvir.FPSCounter;
  138.         CEnvir.FPSCounter = 0;
  139.         CEnvir.DPSCount = CEnvir.DPSCounter;
  140.         CEnvir.DPSCounter = 0;
  141.         DXManager.MemoryClear();
  142.       }
  143.       CEnvir.Connection?.Process();
  144.       DXControl.ActiveScene?.Process();
  145.       string str1 = string.Format("FPS: {0}", (object) CEnvir.FPSCount);
  146.       if (DXControl.MouseControl != null)
  147.         str1 = str1 + ", Mouse Control: " + DXControl.MouseControl.GetType().Name;
  148.       if (DXControl.FocusControl != null)
  149.         str1 = str1 + ", Focus Control: " + DXControl.FocusControl.GetType().Name;
  150.       if (GameScene.Game != null)
  151.       {
  152.         if (DXControl.MouseControl is MapControl)
  153.           str1 += string.Format(", Co Ords: {0}", (object) GameScene.Game.MapControl.MapLocation);
  154.         str1 += string.Format(", Objects: {0}", (object) GameScene.Game.MapControl.Objects.Count);
  155.         if (MapObject.MouseObject != null)
  156.           str1 = str1 + ", Mouse Object: " + MapObject.MouseObject.Name;
  157.       }
  158.       string str2 = str1 + string.Format(", DPS: {0}", (object) CEnvir.DPSCount);
  159.       DXControl.DebugLabel.Text = str2;
  160.       if (CEnvir.Connection != null)
  161.       {
  162.         string str3 = !((Decimal) CEnvir.Connection.get_TotalBytesSent() > 1048576M) ? (!((Decimal) CEnvir.Connection.get_TotalBytesSent() > 1024M) ? string.Format("{0:#,##0}B", (object) CEnvir.Connection.get_TotalBytesSent()) : string.Format("{0:#,##0}KB", (object) ((Decimal) CEnvir.Connection.get_TotalBytesSent() / 1024M))) : string.Format("{0:#,##0.0}MB", (object) ((Decimal) CEnvir.Connection.get_TotalBytesSent() / 1048576M));
  163.         string str4 = !((Decimal) CEnvir.Connection.get_TotalBytesReceived() > 1048576M) ? (!((Decimal) CEnvir.Connection.get_TotalBytesReceived() > 1024M) ? string.Format("{0:#,##0}B", (object) CEnvir.Connection.get_TotalBytesReceived()) : string.Format("{0:#,##0}KB", (object) ((Decimal) CEnvir.Connection.get_TotalBytesReceived() / 1024M))) : string.Format("{0:#,##0.0}MB", (object) ((Decimal) CEnvir.Connection.get_TotalBytesReceived() / 1048576M));
  164.         DXControl.PingLabel.Text = string.Format("Ping: {0}, Sent: {1}, Received: {2}", (object) CEnvir.Connection.Ping, (object) str3, (object) str4);
  165.         DXControl.PingLabel.Location = new Point(DXControl.DebugLabel.DisplayArea.Right + 5, DXControl.DebugLabel.DisplayArea.Y);
  166.       }
  167.       else
  168.         DXControl.PingLabel.Text = string.Empty;
  169.       if (DXControl.MouseControl != null && DXControl.ActiveScene != null)
  170.       {
  171.         DXControl.HintLabel.Text = DXControl.MouseControl.Hint;
  172.         Point point = new Point(CEnvir.MouseLocation.X, CEnvir.MouseLocation.Y + 17);
  173.         if (point.X + DXControl.HintLabel.Size.Width > DXControl.ActiveScene.Size.Width)
  174.           point.X = DXControl.ActiveScene.Size.Width - DXControl.HintLabel.Size.Width - 1;
  175.         if (point.Y + DXControl.HintLabel.Size.Height > DXControl.ActiveScene.Size.Height)
  176.           point.Y = DXControl.ActiveScene.Size.Height - DXControl.HintLabel.Size.Height - 1;
  177.         if (point.X < 0)
  178.           point.X = 0;
  179.         if (point.Y < 0)
  180.           point.Y = 0;
  181.         DXControl.HintLabel.Location = point;
  182.       }
  183.       else
  184.         DXControl.HintLabel.Text = (string) null;
  185.     }

  186.     private static void RenderGame()
  187.     {
  188.       try
  189.       {
  190.         Size clientSize = ((Form) CEnvir.Target).ClientSize;
  191.         int num;
  192.         if (clientSize.Width != 0)
  193.         {
  194.           clientSize = ((Form) CEnvir.Target).ClientSize;
  195.           num = clientSize.Height == 0 ? 1 : 0;
  196.         }
  197.         else
  198.           num = 1;
  199.         if (num != 0)
  200.           Thread.Sleep(1);
  201.         else if (DXManager.DeviceLost)
  202.         {
  203.           DXManager.AttemptReset();
  204.           Thread.Sleep(1);
  205.         }
  206.         else
  207.         {
  208.           DXManager.Device.Clear((ClearFlags) 1, Color4.op_Implicit(Color.Black), 1f, 0);
  209.           DXManager.Device.BeginScene();
  210.           DXManager.Sprite.Begin((SpriteFlags) 16);
  211.           DXControl.ActiveScene?.Draw();
  212.           DXManager.Sprite.End();
  213.           DXManager.Device.EndScene();
  214.           DXManager.Device.Present();
  215.           ++CEnvir.FPSCounter;
  216.         }
  217.       }
  218.       catch (Direct3D9Exception ex)
  219.       {
  220.         DXManager.DeviceLost = true;
  221.       }
  222.       catch (Exception ex)
  223.       {
  224.         CEnvir.SaveError(ex.ToString());
  225.         DXManager.AttemptRecovery();
  226.       }
  227.     }

  228.     public static void ReturnToLogin()
  229.     {
  230.       if (DXControl.ActiveScene is LoginScene)
  231.         return;
  232.       DXControl.ActiveScene.Dispose();
  233.       DXSoundManager.StopAllSounds();
  234.       DXControl.ActiveScene = (DXScene) new LoginScene(Config.IntroSceneSize);
  235.       CEnvir.BlockList = new List<ClientBlockInfo>();
  236.     }
复制代码
传奇3G.jpg
前往下载传奇3G2005源代码C# 逆向Zircon传奇3G源码  提取码回复可见
游客,如果您要查看本帖隐藏内容请回复





上一篇:Zircon传奇3源代码仿韩版黑龙逆向代码C#传奇3源码
下一篇:传奇3G源码大全c#逆向3G2005源代码第二版Ziron
回复

使用道具 举报

0

主题

2

回帖

101

积分

旋风流星刀

积分
101
发表于 2023-7-22 18:16:57 | 显示全部楼层
看看先,谢谢了
回复 支持 反对

使用道具 举报

0

主题

5

回帖

215

积分

旋风流星刀

积分
215
发表于 2023-7-27 16:57:58 | 显示全部楼层
恭喜发财 看看看看
回复 支持 反对

使用道具 举报

0

主题

14

回帖

1237

积分

旋风流星刀

积分
1237
发表于 2023-7-31 11:37:38 | 显示全部楼层
看看,学习学习。。。
回复 支持 反对

使用道具 举报

0

主题

3

回帖

209

积分

旋风流星刀

积分
209
发表于 2024-4-15 09:49:09 | 显示全部楼层
让我看看多少钱
回复 支持 反对

使用道具 举报

0

主题

5

回帖

202

积分

旋风流星刀

积分
202
发表于 6 天前 | 显示全部楼层
6666666666666
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

GMT+8, 2024-4-26 16:39 , Processed in 0.336828 second(s), 79 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表