- Joined
- Oct 22, 2008
- Messages
- 75
- Reaction score
- 143
@pushedx Do you perhaps know the version of this? I might be able to get more recent files.
I don't know an exact version number of this, but based on the patches.dat, the files are from around March 12th, 2010. I've not looked at the packets yet for any useful information, but both the client and server files have dates around that for patch info. Other than that, I can't really tell.
lunia server looks great but may i ask a few questions about it?
how much Memory(Ram) I need to run it? pluses do I need MSSQL or MYSQL? please write a short guide it should helps us.. i read page 1-6 still don't know to how get this server up lol
It's hard to say without testing it on a real server with other players. Based on what I have seen in VM, I'd not try to run it on anything less than 4GB and at least a dual-core 2GHz CPU.
I'm thinking for a real server, and running everything on the same machine, you'd want quad core 2GHz+ and 8gb if not more. That's just my observation though, if you also run the web server and database from the same server, it might be perfectly fine with a lot less, but that seems doubtful.
The game uses ASP Classic and MSSQL (2005 Express Edition+). Ideally, you want Windows Server 2003 (32-bit) and IIS6. The guide I'm working on will address that setup. The files work on IIS7+ and Vista+, but it's a pain to work with and you do have to worry about the security issues of lowering 2008 and IIS7+ settings as much as you do to make it work.
I setup a Windows Server 2008 R2 VM to test some stuff, but the configuration you have to follow there is quite a bit different than if you were to do it on Vista/Win7. I didn't particularly like what I saw from working with Server 2008 and Lunia, so that's why I'm going to focus on 2003. Maybe in the future we can add more configurations.
If you are looking for just anythign to help you get started, try the Lunia (CN) again thread because it has a guide linked inside it. It's not complete, but it should at least get you started.
My guide and repack should be done "soon".
I don't think money actually dropped. Only items. I can't remember how you get money though, perhaps automatically distributed. Try translating text from system message. I'm pretty sure money never dropped, only items.
I considered that a possibility, but that's really quite unfortunate. Thanks for the information though. You can NPC items and sometimes you get coins as stage rewards after the boss battle, but it seems like money is going to be really low, aside from the quest rewards. Oh well, I guess some games are made like that.
I've been looking a little more into the web shop. It seems the money does work right, you can just edit the nCash field directly in Billing/CashPoints. A few minor tweaks and you can also access the shop from outside the client. The initial problems still remain, the ASP is really old, the CSS is old and parts are no longer supported, so pretty much a rewrite is needed. Likewise for the admin page, a few tweaks to make it display the characters correctly, but the interface is really hard to use and loading the items from the DB eats up a ton of CPU whenever you work with the page.
When it comes to the different server exes, there's actually only two unique exes. Lobby, Master, and PVP all use the same exe and Square and Stage use the same exe. The actual configs are what setup all the parts of the server. I wrote a little program to patch the Stage/Square exes at run so only one exe can be used rather than having to use separate folders. The exes are hard coded to use "config.xml" so that's why they couldn't be used in the same folder before. Now though, you can pass the config from my loader program to the exe and it'll use that.
SSLoader.cpp (SquareStageLoader)
Code:
#include <windows.h>
#include <stdio.h>
//-----------------------------------------------------------------------------
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
STARTUPINFOA si = {0};
PROCESS_INFORMATION pi = {0};
si.cb = sizeof(STARTUPINFOA);
char cd[MAX_PATH + 1] = {0};
GetCurrentDirectoryA(MAX_PATH, cd);
char path_to_exe[1024] = {0};
_snprintf(path_to_exe, 1023, "%s\\Stage.exe", cd);
char cmd_line[1024] = {0};
_snprintf(cmd_line, 1023, "\"%s\"", path_to_exe);
BOOL result = (0 != CreateProcessA(0, cmd_line, 0, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi));
if(result == FALSE)
{
MessageBoxA(0, "Could not start \"Stage.exe\".", "Fatal Error", MB_ICONERROR);
return 0;
}
LPVOID pPage = VirtualAllocEx(pi.hProcess, 0, 4096, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
if( pPage == NULL )
{
TerminateProcess(pi.hProcess, 0);
MessageBoxA(0, "Could not write memory to \"Stage.exe\".", "Fatal Error", MB_ICONERROR);
return 0;
}
int nArgs = 0;
LPWSTR * szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
if( NULL == szArglist )
{
TerminateProcess(pi.hProcess, 0);
MessageBoxA(0, "CommandLineToArgvW failed.", "Fatal Error", MB_ICONERROR);
return 0;
}
if(nArgs != 2)
{
VirtualFreeEx(pi.hProcess, pPage, 0, MEM_RELEASE);
TerminateProcess(pi.hProcess, 0);
MessageBoxA(0, "You must pass a commandline to this program.", "Fatal Error", MB_ICONERROR);
return 0;
}
DWORD dwWrite = 0;
result = WriteProcessMemory(pi.hProcess, pPage, szArglist[1], sizeof(wchar_t) * wcslen(szArglist[1]), &dwWrite);
if(result == FALSE || dwWrite != (sizeof(wchar_t) * wcslen(szArglist[1])) )
{
VirtualFreeEx(pi.hProcess, pPage, 0, MEM_RELEASE);
TerminateProcess(pi.hProcess, 0);
MessageBoxA(0, "WriteProcessMemory failed (1).", "Fatal Error", MB_ICONERROR);
return 0;
}
DWORD dwAddr = PtrToUlong(pPage);
result = WriteProcessMemory(pi.hProcess, ULongToPtr(0x40C749 + 1), &dwAddr, sizeof(dwAddr), &dwWrite);
if(result == FALSE || dwWrite != sizeof(dwAddr) )
{
VirtualFreeEx(pi.hProcess, pPage, 0, MEM_RELEASE);
TerminateProcess(pi.hProcess, 0);
MessageBoxA(0, "WriteProcessMemory failed (2).", "Fatal Error", MB_ICONERROR);
return 0;
}
LocalFree(szArglist);
ResumeThread(pi.hThread);
ResumeThread(pi.hProcess);
Sleep(15000);
VirtualFreeEx(pi.hProcess, pPage, 0, MEM_RELEASE);
return 0;
}
//-----------------------------------------------------------------------------
You must be registered to see links
_start.bat is simple:
Code:
start Master.exe master_config.xml
PING -n 5 127.0.0.1>nul
start Master.exe lobby_config.xml
PING -n 5 127.0.0.1>nul
start SSLoader.exe stage_config.xml
PING -n 5 127.0.0.1>nul
start SSLoader.exe square_config.xml
PING -n 5 127.0.0.1>nul
start Master.exe pvp_config.xml
When it comes to the initial SQL database cleanup, I've update my script to cleanup the d-shop and removed some unnecessary inserts. Right now the script looks like this:
Code:
/*
BEFORE YOU RUN:
I'm no MSSQL master, but this is what I have come up with from
researching the issue on how to cleanup tables with FK constraints.
There might be easier ways to do this, but this is what I have for now.
Stage 1:
- Expand "Databases\v3_guild\Tables"
- Right click on "dbo.guild" and choose Design
- Right click on "guildId" and choose "Relationships"
- There should be one relationship, "FK_guildGrade_guild"
- For each relationship:
-- Expand "INSERT And UPDATE Specification" at the bottom
-- Change "Delete Rule" to "Cascade"
-- Change "Update Rule" to "Cascade"
- Hit "Close" and save the table (ctr + s)
- You will get a warning box about changes, hit "Yes"
Stage 2:
- Expand "Databases\v3_character\Tables"
- Right click on "dbo.Accounts" and choose Design
- Right click on "accountName" and choose "Relationships"
- There should be two relationships, "FK_Characters_Accounts"
and "FK_LobbyConnections_Accounts"
- For each relationship:
-- Expand "INSERT And UPDATE Specification" at the bottom
-- Change "Delete Rule" to "Cascade" if it is not already
-- Change "Update Rule" to "Cascade" if it is not already
- Hit "Close" and save the table (ctr + s)
- You will get a warning box about changes, hit "Yes"
Stage 3:
- Expand "Databases\v3_character\Tables"
- Right click on "dbo.Characters" and choose Design
- Right click on "characterName" and choose "Relationships"
- There should be six relationships, "FK_Characters_Accounts", "FK_Items_Characters",
"FK_Licenses_Characters", "FK_QuickSlots_Characters", "FK_SelectedCharacters_Characters",
and "FK_Skills_Characters"
- For each relationship:
-- Expand "INSERT And UPDATE Specification" at the bottom
-- Change "Delete Rule" to "Cascade" if it is not already
-- Change "Update Rule" to "Cascade" if it is not already
- Hit "Close" and save the table (ctr + s)
- You will get a warning box about changes, hit "Yes"
Stage 4:
- Expand "Databases\v3_character\Tables"
- Right click on "LobbyServers" and choose "Relationships"
- There should be one relationship, "FK_LobbyConnections_LobbyServers"
- For each relationship:
-- Expand "INSERT And UPDATE Specification" at the bottom
-- Change "Delete Rule" to "Cascade" if it is not already
-- Change "Update Rule" to "Cascade" if it is not already
- Hit "Close" and save the table (ctr + s)
- You will get a warning box about changes, hit "Yes"
*/
/*
AFTER YOU RUN (optional?):
Go through the above steps again, but change the "Cascade"
back to "None".
I'm not sure if this has to be done or not or what implications
arise if you do or don't.
*/
/********************/
use [Billing]
go
/* Remove all old data */
truncate table CardList
truncate table CardUseLog
truncate table CashPoints
truncate table CashUseLog
go
/********************/
use [v3_gate]
go
/* Remove all old data */
truncate table Connections
/********************/
use [v3_guild]
go
/* Remove all old data */
delete from guild where 1=1
delete from guildGrade where 1=1
truncate table family
truncate table familyMember
truncate table guildNexon
truncate table guildLevel
truncate table guildMaintain
truncate table guildMember
truncate table guildRank
truncate table guildShopProduct
go
/********************/
use [v4_stage]
go
/* Remove all old data */
truncate table ActiveStages
truncate table Connections
truncate table InActiveStages
truncate table LastPlayedStage
truncate table PvpChannels
truncate table PvpConnections
truncate table SquareStages
truncate table StageGroups
truncate table StageServers
/* NOTE: PvpChannels / StageServers are setup for us automatically! */
go
/********************/
use [v3_character]
go
drop table aa
/* Remove all old data */
delete from Accounts where 1=1 /* This might take some time to run */
delete from Characters where 1=1 /* This might take some time to run */
truncate table SkillLicenses
truncate table BankItems
truncate table BankBags
truncate table Bags
truncate table WorkingQuests
truncate table CharacterRebirth
truncate table CharacterLicenses
truncate table Blocking
truncate table CompletedQuests
truncate table InvalidString
truncate table PlayTime
truncate table web_MailItems_History
truncate table web_Mails_History
truncate table LobbyConnections
truncate table PetItems
truncate table PetTraining
truncate table Pets
truncate table Event_PlayTime
truncate table Items
truncate table FriendList
truncate table Event_0901_3Year
truncate table CashItemStorage
truncate table Event_090827_ExpBox
truncate table AddedSkillPoint
truncate table jiangli
truncate table CharacterRename
truncate table Skills
truncate table Market
truncate table QuickSlots
truncate table Licenses
truncate table SelectedCharacters
truncate table Event_PcRoom
truncate table Event_ExpBox
truncate table KeySetting
truncate table Market_History
truncate table MailItems
truncate table Mails
/* TODO: Work this table's data out */
update Constants set CharValue='RageLunia' where KeyName='ServerName'
/* Note: LobbyServers is setup for us at runtime */
delete from LobbyServers where 1=1
go
/********************/
use [d-shop]
go
/* Remove all old data */
truncate table tblCoupon
truncate table tblCoupon_Serial
truncate table tblCoupon_User
truncate table tblOrder
truncate table tblOrder_Coupon
truncate table tblOrder_CouponUse
truncate table tblOrder_Detail
truncate table tblOrder_DetailPackage
truncate table tblOrder_Direct
truncate table tblOrder_Log
truncate table tblOrder_ProductReceive
truncate table tblVIP
/********************/
/*
I think this isn't needed since we truncated all the old data from the
database. I'll leave it in here for reference for future maintence though.
It will generate quite a few (harmless) errors.
*/
/*
use Billing
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
use v3_character
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
use v3_gate
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
use v3_guild
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
use v4_stage
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
use d-shop
EXECUTE sp_MSforeachtable 'DBCC CHECKIDENT ([?], RESEED, 1)';
*/
/********************/
Anyways, I'm going to finish my guides, write a small config tool for my repack, then I'll post here so if anyone is interested in continuing work with the files, they have something a little more easy to work with. Honestly, the files as-is are good enough and it's not really needed, but it was just for fun. I don't think I'll get around to working with the .b files for now, so maybe I'll look into it again in the future. It's just way too time consuming and given the type of game Lunia is, I don't have the time to spend on that for now.