V-IntConnectionsCFG.asm
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:7k
源码类别:

模拟服务器

开发平台:

Asm

  1. ;EasyCodeName=Module1,1
  2. ;-----------------------------------------------------------------------------------
  3. ;    VeMU
  4. ;    Its a package that allows the user to set his own server of the game
  5. ;    "MuOnline", this is not an emulator since i am not "emulating"
  6. ;    what the actual games does, i am "creating" a method for set a Server
  7. ;    of this Game.
  8. ;
  9. ;    Copyright (C) 2010  Felipe Ya馿z
  10. ;
  11. ;    This program is free software: you can redistribute it and/or modify
  12. ;    it under the terms of the GNU General Public License as published by
  13. ;    the Free Software Foundation, either version 3 of the License, or
  14. ;    (at your option) any later version.
  15. ;
  16. ;    This program is distributed in the hope that it will be useful,
  17. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ;    GNU General Public License for more details.
  20. ;
  21. ;    You should have received a copy of the GNU General Public License
  22. ;    along with this program.  If not, see http://www.gnu.org/licenses/.
  23. ;-----------------------------------------------------------------------------------
  24. ;-----------------------------------------------------------------------------------
  25. ;                        -----------------
  26. ;                             Coded     /
  27. ;                              By      /
  28. ;                           -={FeN$x)=-
  29. ;                         /  Felipe Y.  
  30. ;                        /               
  31. ;                        -----------------
  32. ; Programming Lang: ASM
  33. ; Country: Chile
  34. ;              My respect for all those who lost their lifes
  35. ;              In the earthquake of my country...
  36. ;              Let god take their spirits home...
  37. ;-----------------------------------------------------------------------------------
  38. .Const
  39. DefaultServerCode      Equ 0
  40. Default_Ranking_Port   Equ 44455
  41. Default_EventChip_Port Equ 44456
  42. Default_CS_Port        Equ 55557
  43. Default_JS_Port        Equ 55970
  44. Default_ExDB_Port      Equ 55906
  45. Default_DS1_Port       Equ 55960
  46. Default_DS2_Port       Equ 55962
  47. Default_GS_Port        Equ 55901
  48. .Data
  49. ;////////////
  50. ;Strings
  51. ;///////////
  52. DefaultServerName DB "Valkyrie Emulator", 0
  53. DefaultServerVersion DB "0.00.1", 0
  54. IntConnectionsPath DB "./Data/InternalConnections.cfg", 0
  55. DefaultIP DB "127.0.0.1", 0
  56. ;////////////////////////////////////////////////
  57. ;GameServerCFG
  58. ServerName DB 50 Dup(0)
  59. ServerVersion DB 20 Dup(0)
  60. ServerCode Dword ?
  61. GSPort Dword ?
  62. ;JoynServerCFG
  63. JSPort Dword ?
  64. JSIP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  65. ;DataServersCFG
  66. DS2Port Dword ?
  67. DS2IP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  68. DS1Port Dword ?
  69. DS1IP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  70. ;RankingCFG
  71. RankingEventConnect DWord ?
  72. RankPort Dword ?
  73. RankIP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  74. ;EventChipCFG
  75. EventChipConnect DWord ?
  76. EventPort Dword ?
  77. EventIP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  78. ;ExDBCFG
  79. ExDBPort Dword ?
  80. ExDBIP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  81. ;ConnectServerCFG
  82. CSPort Dword ?
  83. CSIP DB 20 Dup(0) ; xxx.xxx.xxx.xxx IP length
  84. ;///////////////////////////////////////////////////
  85. .Data?
  86. .Code
  87. V_ReadIntConnectCFG Proc
  88.  call V_ReadGameServerCfg
  89.  Call V_ReadRankingServerCfg
  90.  Call V_ReadEventChipCfg
  91.  Call V_ReadConnectServerCfg
  92.  Call V_ReadJoynServerCfg
  93.  Call V_ReadExDBServerCfg
  94.  Call V_ReadDataServersCfg
  95.  Ret
  96. V_ReadIntConnectCFG EndP
  97. V_ReadGameServerCfg Proc
  98.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("ServerName"), Addr DefaultServerName, 
  99.                                  Addr ServerName, SizeOf ServerName, Addr IntConnectionsPath
  100.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("ServerVersion"), Addr DefaultServerVersion, 
  101.                                  Addr ServerVersion, SizeOf ServerVersion, Addr IntConnectionsPath
  102.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("GameServerPort"), Default_GS_Port, Addr IntConnectionsPath
  103.  mov GSPort, eax
  104.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("ServerCode"), DefaultServerCode, Addr IntConnectionsPath
  105.  mov ServerCode, eax
  106.  Ret
  107. V_ReadGameServerCfg EndP
  108. V_ReadDataServersCfg Proc
  109.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("DataServerIP1"), Addr DefaultIP, 
  110.                                  Addr DS1IP, SizeOf DS1IP, Addr IntConnectionsPath
  111.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("DataServerIP2"), Addr DefaultIP, 
  112.                                  Addr DS2IP, SizeOf DS2IP, Addr IntConnectionsPath
  113.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("DataServerPort1"), Default_DS1_Port, Addr IntConnectionsPath
  114.  Mov DS1Port, Eax
  115.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("DataServerPort2"), Default_DS2_Port, Addr IntConnectionsPath
  116.  Mov DS2Port, Eax
  117.  Ret
  118. V_ReadDataServersCfg EndP
  119. V_ReadExDBServerCfg Proc
  120.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("ExDBServerIP"), Addr DefaultIP, 
  121.                                  Addr ExDBIP, SizeOf ExDBIP, Addr IntConnectionsPath
  122.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("ExDBServerPort"), Default_ExDB_Port, Addr IntConnectionsPath
  123.  Mov ExDBPort, Eax
  124.  Ret
  125. V_ReadExDBServerCfg EndP
  126. V_ReadJoynServerCfg Proc
  127.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("JoynServerIP"), Addr DefaultIP, 
  128.                                  Addr JSIP, SizeOf JSIP, Addr IntConnectionsPath
  129.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("JoynServerPort"), Default_JS_Port, Addr IntConnectionsPath
  130.  Mov JSPort, Eax
  131.  Ret
  132. V_ReadJoynServerCfg EndP
  133. V_ReadConnectServerCfg Proc
  134.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("ConnectServerIP"), Addr DefaultIP, 
  135.                                  Addr CSIP, SizeOf CSIP, Addr IntConnectionsPath
  136.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("ConnectServerPort"), Default_CS_Port, Addr IntConnectionsPath
  137.  Mov CSPort, Eax
  138.  Ret
  139. V_ReadConnectServerCfg EndP
  140. V_ReadRankingServerCfg Proc
  141.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("RankingServerConnect"), ON, Addr IntConnectionsPath
  142.  Mov RankingEventConnect, Eax
  143.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("RankingServerIP"), Addr DefaultIP, 
  144.                                  Addr RankIP, SizeOf RankIP, Addr IntConnectionsPath
  145.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("RankingServerPort"), Default_Ranking_Port, Addr IntConnectionsPath
  146.  Mov RankPort, Eax
  147.  Ret
  148. V_ReadRankingServerCfg EndP
  149. V_ReadEventChipCfg Proc
  150.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("EventChipConnect"), ON, Addr IntConnectionsPath
  151.  Mov EventChipConnect, Eax
  152.  Invoke GetPrivateProfileString, $CTA0("InternalConnections"), $CTA0("EventChipIP"), Addr DefaultIP, 
  153.                                  Addr EventIP, SizeOf EventIP, Addr IntConnectionsPath
  154.  Invoke GetPrivateProfileInt, $CTA0("InternalConnections"), $CTA0("EventChipPort"), Default_EventChip_Port, Addr IntConnectionsPath
  155.  Mov EventPort, Eax
  156.  Ret
  157. V_ReadEventChipCfg EndP