Jump to content

deguix

Community
  • Content Count

    63
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by deguix

  1. These are the apple.luc and pear.luc files that I decompiled with the help from LuaDec. They can be used instead of the compiled ones with any clients available (just replace them). pear.luc is exactly what was outputted from LuaDec, but apple.luc had some issues. Basically, I replaced the "do break end" parts with "else" and with 1 function, I had to rearrange the ifs so that "if b == true then" and "else" if blocks covered the whole function. The following are the more functional versions of the originals. These were tested with the client built from v2 source (my modifications to it to be published), and should work with any client of any version: apple.luc apple = {} apple_cnt = 0 apple_size = 6 apple_funcs = { [true] = {{lua_fox_boff,true}, {lua_dog_blog,false}}, [false] = {{lua_dog_brog,false}, {lua_fox_boff,true}} } function _fv(b, b2, p, w, v) apple_funcs[b][b2][1](p, w, v) end function _fv2(b, b2, p, w, _v1, _v2) local t = {[true]=_v1,[false]=_v2} _fv(b, b2, p, w, t[apple_funcs[b][b2][2]]) end _k = {0,0,0,0,0,0} _v = {0,0,0,0,0,0} apple_loop1 = function(loop, b, p) for j=0,loop-1 do local w = j * apple_size for i=1,apple_size do _fv2(b, 1, p, w, _k[i], _v[i]) _fv2(b, 2, p, w, _k[i], _v[i]) w = w + 1 end end end apple_loop2 = function(loop, rcnt, b, p) for i=1,rcnt do local w = loop * apple_cnt + i - 1 local a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 _fv2(b, 1, p, w, apple[i], v) _fv2(b, 2, p, w, apple[i], v) end end apple_eat = function(p, l, b) local loop, rcnt = lua_cat_fish(l, apple_cnt) for j=0,loop-1 do apple_loop2(j, apple_cnt, b, p) end apple_loop2(loop, rcnt, b, p) end apple_eat2 = function(p, l, b) local loop, rcnt = lua_cat_fish(l, apple_cnt) apple_loop1(loop, b, p) apple_loop2(loop, rcnt, b, p) end apple_eat2_1 = function(p, l, b) local loop, rcnt = lua_cat_fish(l, apple_size) apple_loop1(loop, b, p) local w = loop * apple_size for i=1,apple_size-1 do --yes, it only uses the first 5 items here _fv(b, 1, p, w, _k[i]) _fv(b, 2, p, w, _v[i]) w = w + 1 if i > rcnt then break end end end apple_allot = function(c, i) local a_ i = i + 1 apple[i] = c apple_cnt = i if i <= apple_size then _k[i] = c a_, _v[i] = lua_cat_fish(c, apple_size) _v[i] = _v[i] + 1 else print("wrong index") end end pear.luc - it's originally the simplest possible already: pear = "" pear_cnt = 0 pear_eat = function(po, pi, l, b) lua_fox_pear(po, pi, l, pear, pear_cnt, b) end pear_allot = function(s, l) pear = s pear_cnt = l end The following is the original apple.luc (with exactly matching assembly chunks compared to original): apple = {} apple_cnt = 0 apple_eat = function(p, l, b) local j = 0 local i = 0 local a = 0 local v = 0 local w = 0 local loop = 0 local rcnt = 0 loop, rcnt = lua_cat_fish(l, apple_cnt) if b == true then while j < loop do i = 0 while i < apple_cnt do w = j * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_fox_boff(p, w, apple[i]) lua_dog_blog(p, w, v) i = i + 1 end j = j + 1 end i = 0 while i < rcnt do w = loop * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_fox_boff(p, w, apple[i]) lua_dog_blog(p, w, v) i = i + 1 end else while j < loop do i = 0 while i < apple_cnt do w = (j) * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_dog_brog(p, w, v) lua_fox_boff(p, w, apple[i]) i = i + 1 end j = j + 1 end i = 0 while i < rcnt do w = loop * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_dog_brog(p, w, v) lua_fox_boff(p, w, apple[i]) i = i + 1 end end end a0 = 0 a1 = 0 a2 = 0 a3 = 0 a4 = 0 a5 = 0 k0 = 0 k1 = 0 k2 = 0 k3 = 0 k4 = 0 k5 = 0 v0 = 0 v1 = 0 v2 = 0 v3 = 0 v4 = 0 v5 = 0 apple_eat2 = function(p, l, b) local j = 0 local i = 0 local a = 0 local v = 0 local w = 0 local loop = 0 local rcnt = 0 loop, rcnt = lua_cat_fish(l, apple_cnt) if b == true then while j < loop do w = j * 6 lua_fox_boff(p, w, k0) lua_dog_blog(p, w, v0) w = w + 1 lua_fox_boff(p, w, k1) lua_dog_blog(p, w, v1) w = w + 1 lua_fox_boff(p, w, k2) lua_dog_blog(p, w, v2) w = w + 1 lua_fox_boff(p, w, k3) lua_dog_blog(p, w, v3) w = w + 1 lua_fox_boff(p, w, k4) lua_dog_blog(p, w, v4) w = w + 1 lua_fox_boff(p, w, k5) lua_dog_blog(p, w, v5) j = j + 1 end i = 0 while i < rcnt do w = loop * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_fox_boff(p, w, apple[i]) lua_dog_blog(p, w, v) i = i + 1 end else while j < loop do w = (j) * 6 lua_dog_brog(p, w, v0) lua_fox_boff(p, w, k0) w = w + 1 lua_dog_brog(p, w, v1) lua_fox_boff(p, w, k1) w = w + 1 lua_dog_brog(p, w, v2) lua_fox_boff(p, w, k2) w = w + 1 lua_dog_brog(p, w, v3) lua_fox_boff(p, w, k3) w = w + 1 lua_dog_brog(p, w, v4) lua_fox_boff(p, w, k4) w = w + 1 lua_dog_brog(p, w, v5) lua_fox_boff(p, w, k5) j = j + 1 end i = 0 while i < rcnt do w = loop * apple_cnt + i a, v = lua_cat_fish(apple[i], apple_cnt) v = v + 1 lua_dog_brog(p, w, v) lua_fox_boff(p, w, apple[i]) i = i + 1 end end end apple_eat2_1 = function(p, l, b) local j = 0 local i = 0 local a = 0 local v = 0 local w = 0 local loop = 0 local rcnt = 0 loop, rcnt = lua_cat_fish(l, 6) if b == true then while j < loop do w = j * 6 lua_fox_boff(p, w, k0) lua_dog_blog(p, w, v0) w = w + 1 lua_fox_boff(p, w, k1) lua_dog_blog(p, w, v1) w = w + 1 lua_fox_boff(p, w, k2) lua_dog_blog(p, w, v2) w = w + 1 lua_fox_boff(p, w, k3) lua_dog_blog(p, w, v3) w = w + 1 lua_fox_boff(p, w, k4) lua_dog_blog(p, w, v4) w = w + 1 lua_fox_boff(p, w, k5) lua_dog_blog(p, w, v5) j = j + 1 end i = 0 if i < rcnt then w = loop * 6 lua_fox_boff(p, w, k0) lua_dog_blog(p, w, v0) i = i + 1 if i < rcnt then w = w + 1 lua_fox_boff(p, w, k1) lua_dog_blog(p, w, v1) i = i + 1 if i < rcnt then w = w + 1 lua_fox_boff(p, w, k2) lua_dog_blog(p, w, v2) i = i + 1 if i < rcnt then w = w + 1 lua_fox_boff(p, w, k3) lua_dog_blog(p, w, v3) i = i + 1 if i < rcnt then w = w + 1 lua_fox_boff(p, w, k4) lua_dog_blog(p, w, v4) end end end end end else while j < loop do w = (j) * 6 lua_dog_brog(p, w, v0) lua_fox_boff(p, w, k0) w = w + 1 lua_dog_brog(p, w, v1) lua_fox_boff(p, w, k1) w = w + 1 lua_dog_brog(p, w, v2) lua_fox_boff(p, w, k2) w = w + 1 lua_dog_brog(p, w, v3) lua_fox_boff(p, w, k3) w = w + 1 lua_dog_brog(p, w, v4) lua_fox_boff(p, w, k4) w = w + 1 lua_dog_brog(p, w, v5) lua_fox_boff(p, w, k5) j = j + 1 end i = 0 if i < rcnt then w = loop * 6 lua_dog_brog(p, w, k0) lua_fox_boff(p, w, v0) i = i + 1 if i < rcnt then w = w + 1 lua_dog_brog(p, w, k1) lua_fox_boff(p, w, v1) i = i + 1 if i < rcnt then w = w + 1 lua_dog_brog(p, w, k2) lua_fox_boff(p, w, v2) i = i + 1 if i < rcnt then w = w + 1 lua_dog_brog(p, w, k3) lua_fox_boff(p, w, v3) i = i + 1 if i < rcnt then w = w + 1 lua_dog_brog(p, w, k4) lua_fox_boff(p, w, v4) end end end end end end end apple_allot = function(c, i) apple[i] = c apple_cnt = i + 1 if i == 0 then k0 = c a0, v0 = lua_cat_fish(c, 6) v0 = v0 + 1 elseif i == 1 then k1 = c a1, v1 = lua_cat_fish(c, 6) v1 = v1 + 1 elseif i == 2 then k2 = c a2, v2 = lua_cat_fish(c, 6) v2 = v2 + 1 elseif i == 3 then k3 = c a3, v3 = lua_cat_fish(c, 6) v3 = v3 + 1 elseif i == 4 then k4 = c a4, v4 = lua_cat_fish(c, 6) v4 = v4 + 1 elseif i == 5 then k5 = c a5, v5 = lua_cat_fish(c, 6) v5 = v5 + 1 else print("wrong index") end end
  2. The actual fix is getting a newer version of the SDL dlls. The game comes with SDL.dll v 1.2.7 and SDL_mixer.dll v 1.2.5 while the latest supported are v 1.2.14 and 1.2.12 respectively, which have this issue fixed.
  3. Did anyone successfully compile the client? Did anyone successfully compile it by recompiling all the packages? Did anyone actually ran the game and made sure it worked after it compiled, all the way? The source code was clearly botched: "vampire" strings, terraininfo and some others bin code commented. Where is gameserver.sql? accountserver.sql is available in the download. I've managed to make the server projects work, but maybe the db needed is different, I can't access the characters from accounts set up from regular 2.x era dbs already available from any 2.x client. Why does the 1.x has the 2.x client src too? I've checked some differences extensively, and it's pretty much a MindPower -> LightEngine rename, dr to lw rename, some memory fixes, drop SDL/AudioSDL/AudioDLL dependencies, the added botched parts above, some extra and not needed forms (used by scenes), and there are more... Does anyone have any links to src from chinese site?
  4. Doesn't work with VS 2008 Express. You need professional or above (Express has no ATL libs - required by client).
  5. You have to disable the Remove unreferenced code and data on libdbc(ServerSdk). Open the serversdk project, right-click libdbc and properties, then C/C++ > Language > "Remove unreferenced code and data" and set it to No, and rebuild. It will fix your problem.
  6. If you want to edit the weather messages - in en_US.txt in the gameserver folder (which gets extracted from en_US.res): GM_WEATHER_CPP_00001 { "Weather: {2} has occurred at location {0} {1}" } Edit it, then compile it back to en_US.res using ICU. To remove it, you would either have to hex it, or to comment a line in the source located in Weather.cpp which contains the GM_WEATHER_CPP_00001 string, and compile it. If your server has voyager skills that don't use energy from corals, removing/commenting AddWeather function calls from lua scripts will work, and won't be missed.
  7. What kind of server can you run with only 256mb ram? A teampk map only server? Max is 2gb and it's still too little.
  8. If I remember right, 1.35 has it enabled as well.
  9. Which src code? 1.3x or 2.x? Did you try to create the simplest possible characteraction with 1 char and 1 pose to test? Which version of libraries did you get? latest or closest to the version already available? I would like to reproduce these steps tomorrow (my day off). ----- Any idea how do I get dx 8.1? I tried using game's but it gives me errors.
  10. The strings won't cause that blue screen - they will cause client to crash on join if I remember right. I'm not sure about that blue scene. Are you sure you have all the files that usually go with the client in the compiled game folder? The scene model is probably missing. Also, if I remember, the game source has some strings in some places that need to be fixed - I don't remember right now but I think garner string is being replaced by something else (at least on 2.x source).
  11. deguix

    TOP 3 ?!

    Well I wish I had known it existed back then, because I did the translation experiment on kop in 2012. I don't know about any server files, but there are 1 of the chinese mirrors still sharing the client from 2012 here: http://youxi.zol.com.cn/down.php?softid=358705&subcatid=62&site=11. Don't bother downloading it though - besides being slow to download and having almost 2gb size, the installer doesn't work. You'd have to extract it with 7z. To get access to the models and lists is even harder - I couldn't do it myself.
  12. You probably don't know this, but the strings below have to be as it is in the source code - if source code is for KOP, then they have to be in Chinese (unless you modify them) - otherwise the client will crash: CL_LANGUAGE_MATCH_465 { "当前会话" } //Local CL_LANGUAGE_MATCH_466 { "好友" } //My Friends CL_LANGUAGE_MATCH_467 { "组队" } //Party CL_LANGUAGE_MATCH_468 { "公会" } //Guild English is possible with the Chinese font - I wish I had the screenshot with me of putting the English translation on the original live KOP server...
  13. I've had to go brainstorm on a formula for the experience table, and just happen to have to graph the current one available, so might as well publish it here (also my guide on top forums disappeared): https://www.desmos.com/calculator/1ybwkcxosv x1 = Level. y1 = Total experience at the start of the level. z1 = Amount of current level experience to get to next level. y1 is the equivalent on what's shown at character_lvup.txt file, except at lvl 81 and above, the z1 is multiplied by 50, to come up with the total for next level. The 2 formulas afterwards determine the closest simple curve (just 1 x to a power) compared to regular experience table. The "residual" (or the difference between approximated curve and the table) can be plotted to show which levels will get harder or easier to level. These approximate functions can't be used directly to build the table - the maximum number needs to fit unsigned 32 bit bounds (4,294,967,295 or (2^32)-1). So you would have to divide the exp by a value - which ends up being the minimum experience per kill. It shouldn't do like top (mutiply by 50 after lvl 80 - which was a stop gap), because either level jumps will happen (on bad code) or the code will bottleneck one of the most important parts of the game (on good code). I've done my calculations and the minimum experience per kill is about 300, but that would mobs that give at most 300 exp per kill (all mobs until lvl 22) give nothing instead, and would also create a level jump between lvl 1 and 8 without experience boosting. The advantage, though, is that it completely erradicates any kind of level jump afterwards - and exp code is much much simpler.
  14. This guide uses the Terminal almost all the way. This is not for everyone, you need some understanding of your Linux! There are 2 versions of SQL available on Linux: 2017 (evaluation - but it's for 64 bit apps only) and 2000. This guide will follow the installation of 2000 - the game can only be run 32 bits... Installing SQL 2000 under wine: Note for 64 bits systems: for any wine/winetricks related instruction to SQL server and your top server, you have to add this: env WINEARCH=win32 WINEPREFIX=~/.wine32 This is because Winetricks prevents dotnet20sp2 from installing into a 64 bits prefix - it is 32 bits only! Examples: env WINEARCH=win32 WINEPREFIX=~/.wine32 winetricks winxp env WINEARCH=win32 WINEPREFIX=~/.wine32 winetricks dotnet20sp2 ... env WINEARCH=win32 WINEPREFIX=~/.wine32 wine MSDE2000A ... First, make sure you have wine and winetricks installed. Then, download MS SQL 2000 from here: https://www.microsoft.com/en-us/download/details.aspx?id=22661. Then, to configure Wine to support SQL 2000, set it to win xp mode and install Net Framework 2.0 SP 2 and MDAC 2.8 (SP 2 is not needed but it is recommended): winetricks winxp winetricks dotnet20sp2 winetricks mdac28 Then, cd to folder where MSDE2000A.exe is and install it - Remember to use .wine32 folder instead of .wine to use the 32 bits prefix on a 64 bit system: wine MSDE2000A.exe wine ~/.wine/drive_c/MSDERelA/setup.exe DISABLEROLLBACK=1 BLANKSAPWD=1 DISABLENETWORKPROTOCOLS=0 SECURITYMODE=SQL The installer will fail! When time out failures start appearing, do a ctrl+c to abort, then copy the remaining files over - - Remember to use .wine32 folder instead of .wine (on both parameters) to use the 32 bits prefix on a 64 bit system, and to use your user name instead of "myusername": cp ~/.wine/drive_c/users/myusername/Temp/SqlSetup/Temp/*.* ~/.wine/drive_c/windows/system32/ Now installation is finished. Restart wine or computer (otherwise SQL service might not run). Then MSSQLSERVER service will start automatically when first running a program on wine on 32 bits prefix. You can also do the following to start it manually directly: wine net start MSSQLSERVER To start the program that controls the service, you can do the following: wine "C:/Program Files/Microsoft SQL Server/80/Tools/Binn/sqlmangr.exe" Sources: http://mynixworld.info/2012/12/22/ms-sql-server-on-linux-yes-it-works/ https://appdb.winehq.org/objectManager.php?sClass=version&iId=11016 Before we continue, the dbs have to be in the same environment of the installed SQL server. That means, you are using the ~/.wine32/drive_c folder on 64 bits and ~/.wine/drive_c on 32 bits. These folders are usually hidden, so you might need to unhide them first (you need to configure that in your system). Then unpack the db files to a folder inside that drive_c folder. --- This guide will show how to setup SQuirreL SQL client. SQuirrel SQL and similar gui clients should be used for fully setup gui Linux environments and ease of use. This guide will assume you already installed the SQL server. Setting up SQuirreL SQL client and connecting to server: Installing: Download it using your package manager - on Arch Linux it's named squirrel-sql. After installing it, download MSSQL JDBC driver depending on the SQL version installed: SQL 2017: version 6+: sqljdbc_6.0.8112.100_enu.tar.gz. Extract sqljdbc41.jar (enu/jre7 folder) if SQL client uses Java 7, or sqljdbc42.jar (enu/jre8 folder) if using Java 8. SQL 2000: version 3.0: sqljdbc_3.0.1301.101_enu.tar.gz. Extract sqljdbc4.jar. Setting up the SQL client: Start the client, click the drivers tab on the left side of the window, then right click "Microsoft MSSQL Server JDBC Driver", then click modify. Click "Extra Class Path" tab, then click "Add" button. Now search for that file you just extracted. Then click "OK". On the bottom of window, you'll see "Driver class com.microsoft.sqlserver.jdbc.SQLServerDriver successfully registered for driver definition: Microsoft MSSQL Server JDBC Driver", that means it worked. Now click the "Aliases" tab on left side of window. Then click the "+" sign button (create new alias). Put any name, select "Microsoft MSSQL Server JDBC Driver". Now for the url, it's going to be like this: jdbc:sqlserver://localhost:1433 localhost can be the ip of your SQL server, if not local, and the 1433 can be changed to another if you have another SQL 2000 instance running or are using another port for the SQL server. The user name is sa, and: SQL 2017: put the sa password given at installation. SQL 2000: leave the pass blank. Then click OK. Connecting to SQL server: Now start SQL server if not started yet: SQL 2017: it already starts on system start. SQL 2000: starts only if you manually run a wine command or run the SQL manager. Then click "Aliases" tab again, select the connection you created, and click the Connect button. To run SQL commands, there's a set of tabs: Objects, SQL, Hibernate, Monitor. Click the SQL tab. Now the torture will start. Type the commands in the SQL commands section and then click the first line, and click the "running guy" button. If you did any mistakes, red text is going to appear on the bottom. SQL Commands: Now continuing, this is the tricky part for those who don't know the SQL language (like me) - you gotta attach using the SQL language (specifically, TSQL for SQL 2000)! The scripts that follow will be the same in all and any SQL clients. Attaching the databases (using SQL 2000 language): EXEC sp_attach_db @dbname = 'dbname', @filename1 = 'dbpathfile.mdf', @filename2 = 'dbpathfile.ldf'; Where dbname is the name of db (either 'accountserver' or 'gamedb'), the dbpathfile.mdf is the path to the db .mdf file in wine, like 'C:\folder\db.mdf' and dbpathfile.ldf is the path to the db .ldf in wine too. So for example: EXEC sp_attach_db @dbname = 'accountserver', @filename1 = 'C:\games\top-server-db\accountserver_data.mdf', @filename2 = 'C:\games\top-server-db\accountserver_log.ldf'; EXEC sp_attach_db @dbname = N'gamedb', @filename1 = N'C:\games\top-server-db\gamedb_data.mdf', @filename2 = N'C:\games\top-server-db\gamedb_log.ldf'; Creating SQL logins (using SQL 2000 language): Now you have to create the logins needed by the server. Type in: EXEC sp_addlogin 'account', 'pass', 'db'; For example: EXEC sp_addlogin 'pko_account', 'Y87dc#$98', 'AccountServer'; EXEC sp_addlogin 'pko_game', 'Y87dc#$98', 'GameDB'; Assigning ownership of databases to a SQL login (using SQL 2000 language): Of course, changing the account names/passwords depending on server file cfgs. Then add the users to the dbs as owners, by typing in: USE db; EXEC sp_adduser 'account', 'account', 'db_owner'; For example: USE AccountServer; EXEC sp_adduser 'pko_account', 'pko_account', 'db_owner'; USE GameDB; EXEC sp_adduser 'pko_game', 'pko_game', 'db_owner'; Creating in-game accounts: Using one of the sql clients above, use the guide below: But just in case the forums get deleted for some reason, it's a good idea to keep a summary of it here - first part to create account, second part to make it gm or not: USE AccountServer; INSERT INTO account_login (name, password) VALUES ('<Login>', '<PasswordMD5>') USE GameDB; INSERT INTO account (act_id, act_name, gm) VALUES ((SELECT MAX(act_id) + 1 FROM account), '<Login>', <GM-level>); Getting the server up and running: Now you also need to unpack the server files to a folder in the: SQL 2000: wine environment used by SQL server. SQL 2017: anywhere as long as you own the folder. It doesn't matter which wine prefix you use either. Databases need to be in the certain folder specified in SQL 2017 guide part. When you do, run them. Now, if you run gameserver, you might run into some errors that usually won't happen in Windows: "Bad allocation" error: Your server is using too much memory. 32 bit programs can use at most 4 GB of memory, but on Linux, for some reason, it can't use that much. Maybe even 2 GB is too much. I'm still not sure how to fix this, but the workaround is to load less things into 1 game server. Running linux with just barebones installed might help (which you would usually do on a dedicated server). "Access Violation" error on GateServer: Regular IP's put at IP key on [ToClient] will make this error to appear. You have to put a long and invalid string on that field. 1231234h25giftuihfi223 is good, hdf8duity357hruasdklhfj is good too. Anything is good, as long as it's not an IP and is long (maybe over 16 bytes long). (EXTRA) Running client on Linux notes: The client can run on a 64 bits prefix wine as well, and performance is like on Windows for me. There are some things to take note that are as follows: It's best to install wine-staging-nine - it has patches that improve dx 9 games. I didn't test the client with it yet, but it should work. Configure it at winecfg at Staging tab. Some private server launchers will require wine-mono to be installed. Net Framework 4.0 might work too (look here: https://wiki.archlinux.org/index.php/wine#Installing_.NET_Framework_4.0). When installing SQL 2000, mono gets uninstalled from that prefix. You might want to create another prefix just for that. The flash bug on the server selection screen has the workaround which is on wine online database. But there's another workaround found by me which only applies to a Linux with borderless and titlebar-less window management - just move the window to the top-left corner until it snaps there. Now Flash will draw normally like on Windows! Removed sections:
  15. deguix

    Official TOP

    That google translated portuguese foxlv message ffs.
  16. Try not to install it, but instead copy and paste the resulting folder after install to a folder in wine and run using wine. It does work on wine under linux.
  17. I think that's precisely it. There might be more differences though, but I hope not. Keep trying it with 2015 and tell us if you run into any other problems (better compatibility is better).
  18. maybe post src code in a git, so that I could clone/fork easily?
×
×
  • Create New...