Jump to content

Fix Source: Kick after selecting character 40k


Recommended Posts

Ok after much searching I found a work around for when a person logs into your server and they select a character and then gets returned to the selection screen. I was using a Loopback Adapter to resolve this but you had to use portmap to make it work fully. Here is a semi fix "but working" You do not have to add anything in your Config files just change this in your source and compile and no need for portmap. Credit go to  rawn3cr0 for this fix

In desc_client.cpp:

if (!bSentBoot)
               {
                  bSentBoot = true;
                  TPacketGDBoot p;
                  p.dwItemIDRange[0] = 0;
                  p.dwItemIDRange[1] = 0;
                  memcpy(p.szIP, g_szPublicIP, 16);
                  DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
               }
            }

            TEMP_BUFFER buf;

            TPacketGDSetup p;

            memset(&p, 0, sizeof(p));
            strlcpy(p.szPublicIP, g_szPublicIP, sizeof(p.szPublicIP));

  Change in:

if (!bSentBoot)
               {
                  bSentBoot = true;
                  TPacketGDBoot p;
                  p.dwItemIDRange[0] = 0;
                  p.dwItemIDRange[1] = 0;
                  memcpy(p.szIP, "External IP", 16);
                  DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
               }
            }

            TEMP_BUFFER buf;

            TPacketGDSetup p;

            memset(&p, 0, sizeof(p));
            strlcpy(p.szPublicIP, "External IP", sizeof(p.szPublicIP));

Where the External IP, modified with your external IP address

if (!bSentBoot)
               {
                  bSentBoot = true;
                  TPacketGDBoot p;
                  p.dwItemIDRange[0] = 0;
                  p.dwItemIDRange[1] = 0;
                  memcpy(p.szIP, "109.197.24.321", 16);
                  DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
               }
            }

            TEMP_BUFFER buf;

            TPacketGDSetup p;

            memset(&p, 0, sizeof(p));
            strlcpy(p.szPublicIP, "109.197.24.321", sizeof(p.szPublicIP));

  

  • Love 1
Link to comment
Share on other sites

Here is another method of fixing the same problem. With this method, one can change the ip in the config files.Both of these methods take like 30 secs or so to show a connection after starting the server. So lets begin.

 

In Config Auth,Ch's,Game99 Use

CONNECTION_IP: Your Wan IP

Game\config.cpp

Go to line 56 and add:

char        g_ipfix[16] = "0";

Go to the 1169 line and add:
 

TOKEN("connection_ip")
     {
       strlcpy(g_ipfix, value_string, sizeof(g_ipfix));
     }

Game \ config.h

Go to line 56 and add:

extern char     g_ipfix[16];

Game\desc_client.cpp

Go to line 149 and replace:

memcpy(p.szIP, g_szPublicIp, 16);

with:

memcpy(p.szIP, g_ipfix, 16);

Go to line 159 and replace:

strlcpy (p.szPublicIP, g_szPublicip, sizeof (p.szPublicIP));

with:

strlcpy(p.szPublicIP, g_ipfix, sizeof(p.szPublicIP));

Compile and your done. Just put CONNECTION_IP: Your Wan IP in your configs and your done.

Credit goes to Arves100

  • Love 1
Link to comment
Share on other sites

  • 8 months later...
  • 10 months later...
  • 2 weeks later...

I've tried both methods and every time the client stucks at "connecting to the server". The sysser on the server is clear, there are no errors. I've also opened the ports: 11002, 13000 , 13001 , 13099 , 13061 , 13002 , 13003 , 13004 , 14099 , 14051 , 14041 , 14031 , 3306 , 22 , 40250. I use the fliege serverfiles.

Link to comment
Share on other sites

  • 1 month later...
On 10/23/2017 at 4:59 AM, monarchis2 said:

Does this work with hamachi?

Uses WAN IP. No need for hamachi....

On 11/8/2017 at 4:54 PM, Calypso said:

Does not work with Hamachi. Game 40250 with portmap..

My friend can not join the server with my IP Hamachi .. Disconned after character select..

No need for portmap or hamachi

Link to comment
Share on other sites

  • 4 weeks later...

HEllo everyone i have problem with connect in game after select character i got kick (40k) i just change in source and binnary source this:

Serverside: desc_client.cpp

if (!bSentBoot)
{
bSentBoot = true;
TPacketGDBoot p;
p.dwItemIDRange[0] = 0;
p.dwItemIDRange[1] = 0;
memcpy(p.szIP, "My IP", 16);
DBPacket(HEADER_GD_BOOT, 0, &p, sizeof(p));
}
}

TEMP_BUFFER buf;

TPacketGDSetup p;

memset(&p, 0, sizeof(p));
strlcpy(p.szPublicIP, "My IP", sizeof(p.szPublicIP));
Clientside: NetAddress.cpp


void CNetworkAddress::GetIP(char* szIP, int len)
{
BYTE IPs[4];
*((DWORD*)IPs)=m_sockAddrIn.sin_addr.s_addr;

_snprintf(szIP, len, "My IP", IPs[0], IPs[1], IPs[2], IPs[3]);

This is fix for select kick and dont work sysser (game1) written :
SYSERR: Dec 6 01:21:37 :: socket_connect: HOST MyIP:14011, could not connect.
I allow ports i dont understand please someone help me

Link to comment
Share on other sites

  • 1 month later...

you change where says My IP?

Clientside: NetAddress.cpp


void CNetworkAddress::GetIP(char* szIP, int len)
{
BYTE IPs[4];
*((DWORD*)IPs)=m_sockAddrIn.sin_addr.s_addr;

_snprintf(szIP, len, "My IP", IPs[0], IPs[1], IPs[2], IPs[3]);



On "My IP" you put your external IP (The ip of your internet expl: "4.131.32.214")....
 

void CNetworkAddress::GetIP(char* szIP, int len)
{
BYTE IPs[4];
*((DWORD*)IPs)=m_sockAddrIn.sin_addr.s_addr;

_snprintf(szIP, len, "4.131.32.214", IPs[0], IPs[1], IPs[2], IPs[3]);

 

  • Good 1
  • Love 1
Link to comment
Share on other sites

  • 10 months later...
  • 4 months later...
  • Contributor

I just tried it and works! (The second solution cause i wanted the config)

 

I connected with a VPN from my laptop, so it wasen't in the internal network.

Without the config it kicked me after charselect, so yeah, working :)

 

I remember before the source we had to use the "sura mc starter", old times... :)

 

 

  • Love 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 5 months later...
  • Developer
On 1/18/2017 at 8:14 AM, DarkOne said:

Here is another method of fixing the same problem. With this method, one can change the ip in the config files.Both of these methods take like 30 secs or so to show a connection after starting the server. So lets begin.

 

In Config Auth,Ch's,Game99 Use

CONNECTION_IP: Your Wan IP

Game\config.cpp

Go to line 56 and add:


char        g_ipfix[16] = "0";

Go to the 1169 line and add:
 


TOKEN("connection_ip")
     {
       strlcpy(g_ipfix, value_string, sizeof(g_ipfix));
     }

Game \ config.h

Go to line 56 and add:


extern char     g_ipfix[16];

Game\desc_client.cpp

Go to line 149 and replace:


memcpy(p.szIP, g_szPublicIp, 16);

with:


memcpy(p.szIP, g_ipfix, 16);

Go to line 159 and replace:


strlcpy (p.szPublicIP, g_szPublicip, sizeof (p.szPublicIP));

with:


strlcpy(p.szPublicIP, g_ipfix, sizeof(p.szPublicIP));

Compile and your done. Just put CONNECTION_IP: Your Wan IP in your configs and your done.

Credit goes to Arves100

 

You shouldn't use line number in your tutorials, they are as you list them only in your source code.

My youtube channel  on which you can see my works here

Link to comment
Share on other sites

  • 6 months later...
  • 3 months later...
  • 2 months later...
  • 1 year later...

Hi, i just did the second modification, in desc_client.cpp, config.cpp and config.h

I 've a VM on virtual box with Hamachi, i used this "[40250] Reference Serverfile By TMP4" package

Is it ok in local, but not with another computer on another network 
I'm still disconnected after i've choose a character 😕

On my local client i've my ip hamachi with .100 and on the other computer it's the real ip hamachi

 

As CONNECTION_IP i placed the hamachi .100 IP

 

Someone can help me ? 

Link to comment
Share on other sites

  • Contributor
5 hours ago, Chaussette said:

I 've a VM on virtual box with Hamachi, i used this "[40250] Reference Serverfile By TMP4" package

1. This tutorial is outdated, there is a newer version with a better code: 

However you do not need to install it because I did it. Just configure your IP in the CONFIG files. 

Please read Karbust topic or my FAQ.txt file where you downloaded the serverfile to get more information how to use it. And don't forget to revert the changes you made from this topic.

  • Good 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.