Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[WIP]LunaSource Repack

(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Offtopic
So I have attempted to convert some luna projects so that they can be compiled with vs2012. Unfortunately files had issues and needed more fixes to use latest sdk. Of course you can use old sdk and old compile and perhaps compile it in vs2012, but it is just useless. So I have put that aside until I have enough knowledge to convert files completely. Instead I have setup a VM to work on repack.

Plan/TODO:
  • Remove files and projects that are not related to Luna Online
  • Remove unnecessary configurations or configurations for other EYA Interactive games
  • Restructure 4Dyuich engine a little
  • Update libraries (i.e. ziparchive, curl, directx...)
  • Remove configurations for specific locales such as Japan, Taiwan, China, and so on
  • Restructure and organize source code overall
  • Setup project dependencies
  • Finish script for copying and re-organizing compiled files. (ClientDebug, Client Release, Server, and so on.)


Sidenotes
  • All original tools for file packing/unpacking will be removed and replaced with generic pack/unpack tool
    • Select .bin files, drag onto .exe file, and they get decrypted/unpacked. Same for .txt files but other way around
    • Similar process for .pack files

Status

  • LunaClient
    • haven't looked at yet
    • too many configurations to go over
  • FileStorage
    • reorganized; compiles;
  • Func
    • reorganized; compiles;
  • Geometry
    • reorganized; compiles;
  • Renderer
    • reorganized; compiles;
  • Network
    • reorganized; compiles;
  • Executer
    • reorganized; compiles;
  • LunaExecuter
    • reorganized; compiles;
  • LunaLauncher
    • reorganized; compiles;
    • need to remove extra code for locales and make sure it loads patch server settings from a file and not binary
  • Sound
    • reorganized; compiles;
    • might update to latest miles sound library
  • DBThread
    • reorganized; compiles;

Disclaimer: This is something I will hopefully finish as a side project. No support will be provided. I do not guarantee that I will not mess something up.

Instructions
  1. Download 7z file and unpack it.
  2. Open LunaDevFolder and then 7830dd80e4db108c
  3. Open LunaEngine solution and build release or debug. There will be errors because I havent setup project dependencies and post-build events
  4. Run CopyFiles.bat once and it will copy Func library to Lib folder
  5. Build LunaEngine solution again and everything should build. If not then build again.
  6. Open LunaExecutables solution and build it.
  7. You can run CopyFiles.bat which will copy compiled files to ClientDebug/ReleaseOutput. Other files can be found in Output folder.


Download
  • 06-21-2013


Meanwhile feel free to post requests related to the luna source structure, etc. I expect to have repack ready by end of June. Also if anyone can provided test server (not live), that is already setup, it would help me make sure nothing is broken after repack is done.
 
Last edited:
I play it straight up, yo
Joined
May 19, 2012
Messages
931
Reaction score
121
Client DLL's

  • SoundLib.dll - Not using Sound.dll - redirect client to use Sound.dll.
  • SS3DGFuncSSE.dll - Needs a Configuration in LunaEngine.sln - Needs to be renamed, try Func-SSE.
  • FreeImage - Needs to be copied from client FreeImage Folder, and placed in both Release and Debug folders.
The Client Itself

  • Client.debug - Configuration is using NProtect, Drop _NPROTECT_ from preprocessor.
  • Client-debug - Unexpect crash - After debugging: Unhandled exception at 0x779615de in LUNAClient-Debug.exe: 0x00000000

Server side runs fine, well at least after an hours worth of setting up a new one, damn databases went offline. The Client side on the other hand had trouble, as you can tell from top portion. I hope that when I was debugging it that this is the info you wanted.

Also, what was wrong with your original repack?
 
Last edited:
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Client DLL's

  • SoundLib.dll - Not using Sound.dll - redirect client to use Sound.dll.

  • SS3DGFuncSSE.dll - Needs a Configuration in LunaEngine.sln - Needs to be renamed, try Func-SSE.

  • FreeImage - Needs to be copied from client FreeImage Folder, and placed in both Release and Debug folders.
The Client Itself

  • Client.debug - Configuration is using NProtect, Drop _NPROTECT_ from preprocessor.

  • Client-debug - Unexpect crash - After debugging: Unhandled exception at 0x779615de in LUNAClient-Debug.exe: 0x00000000

Server side runs fine, well at least after an hours worth of setting up a new one, damn databases went offline. The Client side on the other hand had trouble, as you can tell from top portion. I hope that when I was debugging it that this is the info you wanted.

Also, what was wrong with your original repack?


  • After posting I realized that client was using SoundLib from its Audio folder. In next upload it should be using Sound.lib built from Solution/Sound folder instead.
  • Actually if I am not mistaken the SSE configuration used asm code for some math functions. I replaced original Release&Debug with the ones for SSE. I'll take a look if there are issues.
  • Will add FreeImage
  • Will drop nprotect

What do you mean by "your original repack"? The original source files?
Edit1: Try using debug gm tool instead.
 
Last edited:
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
A long time ago you uploaded a luna online plus source code, it seemed pretty optimized because a lot of the configurations were changed up.

Honestly I can't remember me uploading source files. Nonetheless I will be working on these sources now.

If someone can elaborate on SSE configuration of Func library that would be great. Last time I checked SSE configuration used asm for some of the functions. Also three output files for Func library had different optimizations one of them compiled with asm code. I think client, server, and tools should work just fine with single file.

I fixed everything that was mentioned above, however having some issues with bin files. Next upload should be up On Sunday Evening PST (23rd June)
 
I play it straight up, yo
Joined
May 19, 2012
Messages
931
Reaction score
121
Honestly I can't remember me uploading source files. Nonetheless I will be working on these sources now.

If someone can elaborate on SSE configuration of Func library that would be great. Last time I checked SSE configuration used asm for some of the functions. Also three output files for Func library had different optimizations one of them compiled with asm code. I think client, server, and tools should work just fine with single file.

I fixed everything that was mentioned above, however having some issues with bin files. Next upload should be up On Sunday Evening PST (23rd June)

Define asm, are you talking about Inline Assembly?
 
(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
Define asm, are you talking about Inline Assembly?
Yea the assembly code in Func\global.h

Edit:
I looked at LunaExecuter and found following line of code.
Code:
CopyFile(IsSupportSSE() ? _T("SS3DGFuncSSE.dll") : _T("SS3DGFuncN.dll"), _T("SS3DGFunc.dll"), FALSE);
Executer checks if cpu supports SSE instructions. If it does then SSE func is used, otherwise FuncN will be used. It selects either of the files and copies it as SS3DFunc.dll
And again, _WITH_SSE preprocessor just compiles the code with some assembly code that uses SSE instructions.

I think this was more revelant when the game was being coded, but nowadays pretty much all cpus support sse.
Therefore the sources will use Func dll with SSE instructions. Your welcome to remove the preprocessor _FOR_SSE if you choose so.

Another edit:
Other dll files (Geometry, Executive, FileStorage, etc) included debug library of func, no matter of configuration. I am not sure if it was done for a reason or not. I replaced that the code to include the debug/release lib of func dependent on configuration.

Code:
#ifdef NDEBUG
#pragma comment(lib, "..\\Lib\\Release\\Func.lib")
#else
#pragma comment(lib, "..\\Lib\\Debug\\Func.lib")
#endif

Could this be problematic in future?

Yet another edit:
Currently stuck with client crashing. Might have to start over with client code.
> ntdll.dll!77de15de()
 
Last edited:
Elite Diviner
Joined
Feb 27, 2012
Messages
446
Reaction score
46
When i compile them it doesn't put anything into the output folder i think, Nothing copies or anything.
 
Elite Diviner
Joined
Feb 27, 2012
Messages
446
Reaction score
46
I was looking at the area it copies from and the area it copies to so the output folder in 7830dd80e4db108c and the folders outside of that. The only folders it filled in the output folder were in Network and Sound. When it copied over this is what i got
That is the same for both folders, and it is only LunaEngine





There are some screens if that helps.
I am using vs2012 Express and i run on win 7 if that helps also xD.
 
Last edited:
I play it straight up, yo
Joined
May 19, 2012
Messages
931
Reaction score
121
I would recommend using originally released source code. This is work in progress thing. This shouldn't be used on live server yet.

I was compile the client with _ERROR_REPORT_ in the preprocessors, and I keep getting the best linker error of all, the Link.exe mismatched with c2.dll. Leave it to researching for days for a hint or solution, and not find any solution. Got any advice on it?

I would imagine that its because I'm using Enterprise Architect instead of Developer.
 
Back
Top