Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 4Story
You last visited: Today at 22:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server setup - help request

Discussion on Server setup - help request within the 4Story forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2021
Posts: 17
Received Thanks: 0
Server setup - help request

Hello everyone, I have decided to dive into server development learning so that I can contribute to future project and help the community. The main goal is setting up a server a successfully logging-in.

I have decided to use the Sources (Old-School), which I believe are 3.5 sources. This time with VS 2003 and SQL Express 2022. I compiled both Server and Client without any major issues, ending with 0 errors and 0 warnings. Both solutions linked to the same TProtocol.

For TServer I compiled TNetLib, TControl, TLogin, TMap, TWorld, TRelay and TPatch.

For TClient I compiled TProtocol, Engine Lib, TachyonControl, TachyonShader, TClient.

Now I realize I Rebuilt TServer linking to TProtocol which I later rebuild inside the TClient - could that be a problem?

Every service is up and running except for the TRelay, which starts and shuts down immidiatelly, but I suppose you do not need it for test login, right?

I then replaced the TClient inside the Classic4story data folder with the newly compiled TClient, but upon log-in I still get the same network connection error (A network error has caused the server connection to fail).

I checked all I could but I cannot get pass the log-in screen. Any advices? If there is any experienced dev willing to help via discord, please feel free to add me: #filas2968.
filda123xx is offline  
Old 10/08/2025, 01:01   #2
 
Demnian's Avatar
 
elite*gold: 0
Join Date: Jun 2015
Posts: 41
Received Thanks: 23
U need edit TLoginSvr->TLoginSvr.cpp
Quote:
BYTE CTLoginSvrModule::Accept()
{
#ifndef _DEBUG
if(IsDebuggerPresent())
return FALSE;
#endif

if(m_accept == INVALID_SOCKET)
{
m_vAccept.Clear();
return FALSE;
}

BYTE bError = FALSE;
CTUser *pUser = new CTUser();

pUser->Open( m_accept, m_vAccept);
pUser->m_Recv.ExpandIoBuffer(RECV_CLI_SIZE);

if( pUser->m_addr.sin_addr.s_addr == m_addrCtrl.sin_addr.s_addr )
pUser->m_bSessionType = SESSION_SERVER;
else
{
pUser->m_bUseCrypt = TRUE;

#ifndef _DEBUG
SOCKADDR_IN *pAddr = (SOCKADDR_IN *) (m_vAccept.GetBuffer() + 10);
if(pAddr->sin_addr.s_addr << 8 != 0x5F6E4F00 && pAddr->sin_addr.s_addr << 8 != 0xAFFDCE00)
switch(pAddr->sin_addr.s_addr)
{
case 268544192:
case 100772032:
case 2302251482:
case 2778016723:
case 903795800:
case 937350232:
case 140471887:
case 89681487:
case 190344783:
case 207121999:
case 223899215:
case 609775183:
case 676884047:
case 626552399:
case 565181902:
case 760770127:
case 3596119631:
case 794324559:
case 1297641039:
case 1331195471:
case 1347972687:
case 3394793039:
case 3461901903:
case 3512233551:
case 3445124687:
case 3495456335:
case 3478679119:
case 3378015823:
case 3411570255:
case 3361238607:
case 3529010767:
case 3562565199:
case 3579342415:
case 2785126592:
break;
default:
bError = TRUE;
break;
}
#endif
}

m_accept = INVALID_SOCKET;
m_vAccept.Clear();

if(bError)
{
pUser->Close();
delete pUser;

return FALSE;
}

/*
if( pUser->m_bSessionType == SESSION_CLIENT &&
MAKEWORD(pUser->m_addr.sin_zero[1], pUser->m_addr.sin_zero[0]) != TVERSION)
{
delete pUser;
return FALSE;
}
*/
HANDLE hIocpWork = CreateIoCompletionPort(
(HANDLE) pUser->m_sock,
m_hIocpWork,
COMP_SESSION, 0);

SMART_LOCKCS(&m_csLI)

if( !hIocpWork || !pUser->WaitForMessage() )
{
pUser->Close();
delete pUser;

return FALSE;
}

pUser->m_dwAcceptTick = GetTickCount();

ATLTRACE2( "SESSION INSERT %s, %d\n", inet_ntoa(pUser->m_addr.sin_addr), m_mapTSESSION.size());
m_mapTSESSION.insert( MAPTUSER::value_type( (DWORD_PTR) pUser, pUser));

return TRUE;
}
Replace to:
Quote:
BYTE CTLoginSvrModule::Accept()
{
#ifndef _DEBUG
if(IsDebuggerPresent())
return FALSE;
#endif

if(m_accept == INVALID_SOCKET)
{
m_vAccept.Clear();
return FALSE;
}

BYTE bError = FALSE;
CTUser *pUser = new CTUser();

pUser->Open( m_accept, m_vAccept);
pUser->m_Recv.ExpandIoBuffer(RECV_CLI_SIZE);

if( pUser->m_addr.sin_addr.s_addr == m_addrCtrl.sin_addr.s_addr )
pUser->m_bSessionType = SESSION_SERVER;
else
{
pUser->m_bUseCrypt = TRUE;

#ifndef _DEBUG
SOCKADDR_IN *pAddr = (SOCKADDR_IN *) (m_vAccept.GetBuffer() + 10);
if(pAddr->sin_addr.s_addr << 8 != 0x5F6E4F00 && pAddr->sin_addr.s_addr << 8 != 0xAFFDCE00)
switch(pAddr->sin_addr.s_addr)
{
case 268544192:
case 100772032:
case 2302251482:
case 2778016723:
case 903795800:
case 937350232:
case 140471887:
case 89681487:
case 190344783:
case 207121999:
case 223899215:
case 609775183:
case 676884047:
case 626552399:
case 565181902:
case 760770127:
case 3596119631:
case 794324559:
case 1297641039:
case 1331195471:
case 1347972687:
case 3394793039:
case 3461901903:
case 3512233551:
case 3445124687:
case 3495456335:
case 3478679119:
case 3378015823:
case 3411570255:
case 3361238607:
case 3529010767:
case 3562565199:
case 3579342415:
case 2785126592:
break;
default:
bError = FALSE;
break;
}
#endif
}

m_accept = INVALID_SOCKET;
m_vAccept.Clear();

if(bError)
{
pUser->Close();
delete pUser;

return FALSE;
}

/*
if( pUser->m_bSessionType == SESSION_CLIENT &&
MAKEWORD(pUser->m_addr.sin_zero[1], pUser->m_addr.sin_zero[0]) != TVERSION)
{
delete pUser;
return FALSE;
}
*/
HANDLE hIocpWork = CreateIoCompletionPort(
(HANDLE) pUser->m_sock,
m_hIocpWork,
COMP_SESSION, 0);

SMART_LOCKCS(&m_csLI)

if( !hIocpWork || !pUser->WaitForMessage() )
{
pUser->Close();
delete pUser;

return FALSE;
}

pUser->m_dwAcceptTick = GetTickCount();

ATLTRACE2( "SESSION INSERT %s, %d\n", inet_ntoa(pUser->m_addr.sin_addr), m_mapTSESSION.size());
m_mapTSESSION.insert( MAPTUSER::value_type( (DWORD_PTR) pUser, pUser));

return TRUE;
}
And use password in md5 hash
Demnian is offline  
Reply

Tags
4story, help 4s


Similar Threads Similar Threads
Discord Server Setup | NFT Discord Server Setup | HIGH QUALITY | 7/24 SUPPORT
09/18/2022 - Discord Trading - 1 Replies
Are you ready to meet DIscord, the leader of the new world? Hello, I'm WuuZy. Who Is This WuuZy -> I am a simple person who works as a Freelancer from time to time. I've been dealing with Discord from about January 2015. -> I've made about +128 servers so far. I have been a manager of many communities. I am actively managing a server with +13K members.
[Selling] Ragnar Service | Server Setup | Website Setup | Deutsch |
07/20/2017 - Silkroad Online Trading - 4 Replies
http://i.epvpimg.com/20Fseab.png Servers setup | Webseite setup | bei bedarf auch Logos Einen Service für den schnellen Setup deines Servers und für deine Webseite Ich habe mich entschlossen diese Arbeit die ich als Hobby gemacht habe nun für Sie zu betreiben Erfahrungen: Natürlich habe ich schon an vielen Servern gearbeitet und deshalb sind meine Erfahrungen gestiegen jeden Tag entwickel ich mich und lerne dazu
What VirtualPC download is better? -32 BIT/setup.exe30.4MB 64 BIT/setup.exe30.5MB
03/30/2011 - Metin2 Private Server - 1 Replies
32 BIT/setup.exe30.4MB Download 64 BIT/setup.exe30.5MB Download TELL ME !



All times are GMT +1. The time now is 22:32.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.