[Question] Running 2 GS on 1 Shard and 1Agent Srv on same IP and same machine

10/28/2024 12:46 hexcode#1
Hello everyone! We have a small non-bot server that we've been supporting for the last 7 years. The server is based on BRFiles and is limited to 10D, so we're running only one Game Server, one Shard Server, and one Agent Server. We've optimized the server to handle up to 48,000 objects, but after 1-2 weeks of continuous operation without a restart, the object count rises to 49,000, causing some regions to start lagging. This happens faster when events like winter, Halloween, or Easter are active. To prevent reaching the 50k limit and to extend the time between restarts, we're trying to add a second Game Server.

The goal is to add a second Game Server while using a single IP address on the same server machine. I've patched all server modules to allow them to start on the same PC (cannot create semaphore: module already executing) and added the second Game Server and second Machine manager in certification.

However, there’s an issue: when both are running on the same IP and same machine, I can only operate one Machine Manager and one Game Server. For instance, if I start the second Machine Manager, the Global Manager throws this error: server cord already established: created session overlapped. If I bypass this error by patching the Global Manager, both Machine Managers connected , but both work as primary[102] (not [102] and [103]) and only one of them(first started) is shows as active in Global Manager diagram.How the Global manager decide which connected module is [102] and who to be [103]? Is it the wip/nip IP in srNodeType?


Running 2 Machine managers on patched Global manager
[Only registered and activated users can see links. Click Here To Register...]

I'm wondering if it's even possible to run this configuration on a single machine with the same real IP. Could the certification we’re using be the problem? In tests with one physical machine and one VM on LOCAL network (192.xxx.xxx.xxx), both Game Servers worked fine using the same certification.

Certification module in use:
[Only registered and activated users can see links. Click Here To Register...]

Certification diagram:
[Only registered and activated users can see links. Click Here To Register...]

Global Manager error (before patching) when trying to connect the second Machine Manager:
[Only registered and activated users can see links. Click Here To Register...]

Certification srNodeType config:
[Only registered and activated users can see links. Click Here To Register...]


I also tried a scenario with one physical machine using a real IP (e.g., 109.109.109.109) and a VM with a local IP (192.168.50.100), but the same problem occurs – only one Machine Manager/Game Server can be certified, with overlap errors in the Global Manager. The only solution that has worked so far is running everything in a local network (192.xxx.xxx.xxx) and redirecting ports from the external IP to the local network, but this isn’t an option right now.

Has anyone successfully made this setup work on a single machine with a single real IP?

Any hints would be greatly appreciated.


Regards
10/28/2024 21:02 Judgelemental#2
Quote:
Originally Posted by hexcode View Post
Hello everyone! We have a small non-bot server that we've been supporting for the last 7 years. The server is based on BRFiles and is limited to 10D, so we're running only one Game Server, one Shard Server, and one Agent Server. We've optimized the server to handle up to 48,000 objects, but after 1-2 weeks of continuous operation without a restart, the object count rises to 49,000, causing some regions to start lagging. This happens faster when events like winter, Halloween, or Easter are active. To prevent reaching the 50k limit and to extend the time between restarts, we're trying to add a second Game Server.

The goal is to add a second Game Server while using a single IP address on the same server machine. I've patched all server modules to allow them to start on the same PC (cannot create semaphore: module already executing) and added the second Game Server and second Machine manager in certification.

However, there’s an issue: when both are running on the same IP and same machine, I can only operate one Machine Manager and one Game Server. For instance, if I start the second Machine Manager, the Global Manager throws this error: server cord already established: created session overlapped. If I bypass this error by patching the Global Manager, both Machine Managers connected , but both work as primary[102] (not [102] and [103]) and only one of them(first started) is shows as active in Global Manager diagram.How the Global manager decide which connected module is [102] and who to be [103]? Is it the wip/nip IP in srNodeType?


Running 2 Machine managers on patched Global manager
[Only registered and activated users can see links. Click Here To Register...]

I'm wondering if it's even possible to run this configuration on a single machine with the same real IP. Could the certification we’re using be the problem? In tests with one physical machine and one VM on LOCAL network (192.xxx.xxx.xxx), both Game Servers worked fine using the same certification.

Certification module in use:
[Only registered and activated users can see links. Click Here To Register...]

Certification diagram:
[Only registered and activated users can see links. Click Here To Register...]

Global Manager error (before patching) when trying to connect the second Machine Manager:
[Only registered and activated users can see links. Click Here To Register...]

Certification srNodeType config:
[Only registered and activated users can see links. Click Here To Register...]


I also tried a scenario with one physical machine using a real IP (e.g., 109.109.109.109) and a VM with a local IP (192.168.50.100), but the same problem occurs – only one Machine Manager/Game Server can be certified, with overlap errors in the Global Manager. The only solution that has worked so far is running everything in a local network (192.xxx.xxx.xxx) and redirecting ports from the external IP to the local network, but this isn’t an option right now.

Has anyone successfully made this setup work on a single machine with a single real IP?

Any hints would be greatly appreciated.


Regards
Might not be what you're looking for, but have you tried increasing the cap from 50k max objects to more?
I have 120.000 /worldstats on my server running for years without any issues.
There's a thread that explains it, unfortunately it is for vsro and I cannot find it.

[Only registered and activated users can see links. Click Here To Register...]
10/28/2024 21:24 hexcode#3
Quote:
Originally Posted by Judgelemental View Post
Might not be what you're looking for, but have you tried increasing the cap from 50k max objects to more?
I have 120.000 /worldstats on my server running for years without any issues.
There's a thread that explains it, unfortunately it is for vsro and I cannot find it.

[Only registered and activated users can see links. Click Here To Register...]

Yeah , i am trying to increase max object to be over 50k.Thats why i try to run 2nd GS. You are using patched max count on single GS from 50k ->120k and this solution work without any lag?

Regards
10/28/2024 21:58 Judgelemental#4
Quote:
Originally Posted by hexcode View Post
Yeah , i am trying to increase max object to be over 50k.Thats why i try to run 2nd GS. You are using patched max count on single GS from 50k ->120k and this solution work without any lag?

Regards
I've just checked again.

My /worldstats is around 93.000. More than 100.000 and the GS crashes.
Keep it under 100k and try. There is no lag whatsoever.
However I do not know the offsets for br files.
10/28/2024 22:15 hexcode#5
Quote:
Originally Posted by Judgelemental View Post
I've just checked again.

My /worldstats is around 93.000. More than 100.000 and the GS crashes.
Keep it under 100k and try. There is no lag whatsoever.
However I do not know the offsets for br files.
Thanks for work around. I will try to find the offset for the BR Files and will test for lag. I think running 2nd game server is better solution, thats why i will not give up to make it work on single machine, because i think the 50 k limit is out by Joymax for a reason.

---------------------------------------------------
Update:
I found the offset for the BR Files.I will post it here if someone else need it.Today will try to patch it and test it:

Code:
00540BC0  /$ 6A FF          PUSH -1
00540BC2  |. 68 5B53A300    PUSH SR_GameS.00A3535B
00540BC7  |. 64:A1 00000000 MOV EAX,DWORD PTR FS:[0]
00540BCD  |. 50             PUSH EAX
00540BCE  |. 83EC 08        SUB ESP,8
00540BD1  |. 53             PUSH EBX
00540BD2  |. 55             PUSH EBP
00540BD3  |. 56             PUSH ESI
00540BD4  |. 57             PUSH EDI
00540BD5  |. A1 8412BE00    MOV EAX,DWORD PTR DS:[BE1284]
00540BDA  |. 33C4           XOR EAX,ESP
00540BDC  |. 50             PUSH EAX
00540BDD  |. 8D4424 1C      LEA EAX,DWORD PTR SS:[ESP+1C]
00540BE1  |. 64:A3 00000000 MOV DWORD PTR FS:[0],EAX
00540BE7  |. 33C9           XOR ECX,ECX
00540BE9  |. B8 50C30000    MOV EAX,0C350
00540BEE  |. BA D0010000    MOV EDX,1D0
00540BF3  |. F7E2           MUL EDX
00540BF5  |. 8B7424 2C      MOV ESI,DWORD PTR SS:[ESP+2C]
00540BF9  |. 0F90C1         SETO CL
00540BFC  |. C746 20 50C300>MOV DWORD PTR DS:[ESI+20],0C350
00540C03  |. F7D9           NEG ECX
00540C05  |. 0BC8           OR ECX,EAX
00540C07  |. 33C0           XOR EAX,EAX
00540C09  |. 83C1 04        ADD ECX,4
00540C0C  |. 0F92C0         SETB AL
00540C0F  |. F7D8           NEG EAX
00540C11  |. 0BC1           OR EAX,ECX
00540C13  |. 50             PUSH EAX
00540C14  |. E8 A0B94200    CALL SR_GameS.0096C5B9
00540C19  |. 83C4 04        ADD ESP,4
00540C1C  |. 894424 18      MOV DWORD PTR SS:[ESP+18],EAX
00540C20  |. 33ED           XOR EBP,EBP
00540C22  |. 896C24 24      MOV DWORD PTR SS:[ESP+24],EBP
00540C26  |. 3BC5           CMP EAX,EBP
00540C28  |. 74 32          JE SHORT SR_GameS.00540C5C
00540C2A  |. 68 50295300    PUSH SR_GameS.00532950                   ;  Entry address
00540C2F  |. 68 80225300    PUSH SR_GameS.00532280
00540C34  |. 68 50C30000    PUSH 0C350
00540C39  |. 8D78 04        LEA EDI,DWORD PTR DS:[EAX+4]
00540C3C  |. 68 D0010000    PUSH 1D0
00540C41  |. 57             PUSH EDI
00540C42  |. C700 50C30000  MOV DWORD PTR DS:[EAX],0C350
00540C48  |. E8 1BCB4200    CALL SR_GameS.0096D768
00540C4D  |. C74424 24 FFFF>MOV DWORD PTR SS:[ESP+24],-1
00540C55  |. 897E 04        MOV DWORD PTR DS:[ESI+4],EDI
00540C58  |. 33DB           XOR EBX,EBX
00540C5A  |. EB 18          JMP SHORT SR_GameS.00540C74
00540C5C  |> 33FF           XOR EDI,EDI
00540C5E  |. C74424 24 FFFF>MOV DWORD PTR SS:[ESP+24],-1
00540C66  |. 897E 04        MOV DWORD PTR DS:[ESI+4],EDI
00540C69  |. 33DB           XOR EBX,EBX
00540C6B  |. EB 07          JMP SHORT SR_GameS.00540C74
00540C6D  |  8D49 00        LEA ECX,DWORD PTR DS:[ECX]
00540C70  |> 8B7424 2C      MOV ESI,DWORD PTR SS:[ESP+2C]
00540C74  |> 8B4E 04        MOV ECX,DWORD PTR DS:[ESI+4]
00540C77  |. 8B1419         MOV EDX,DWORD PTR DS:[ECX+EBX]
00540C7A  |. 8B42 58        MOV EAX,DWORD PTR DS:[EDX+58]
00540C7D  |. 03CB           ADD ECX,EBX
00540C7F  |. 83C5 01        ADD EBP,1
00540C82  |. 55             PUSH EBP
00540C83  |. 894C24 1C      MOV DWORD PTR SS:[ESP+1C],ECX
00540C87  |. FFD0           CALL EAX
00540C89  |. 8D46 08        LEA EAX,DWORD PTR DS:[ESI+8]
00540C8C  |. 8B70 04        MOV ESI,DWORD PTR DS:[EAX+4]
00540C8F  |. 8B56 04        MOV EDX,DWORD PTR DS:[ESI+4]
00540C92  |. 8D4C24 18      LEA ECX,DWORD PTR SS:[ESP+18]
00540C96  |. 51             PUSH ECX                                 ; /Arg3
00540C97  |. 52             PUSH EDX                                 ; |Arg2
00540C98  |. 56             PUSH ESI                                 ; |Arg1
00540C99  |. E8 F2490000    CALL SR_GameS.00545690                   ; \SR_GameS.00545690
00540C9E  |. 8B4C24 2C      MOV ECX,DWORD PTR SS:[ESP+2C]
00540CA2  |. 83C1 08        ADD ECX,8
00540CA5  |. 8BF8           MOV EDI,EAX
00540CA7  |. E8 944A0000    CALL SR_GameS.00545740
00540CAC  |. 897E 04        MOV DWORD PTR DS:[ESI+4],EDI
00540CAF  |. 8B47 04        MOV EAX,DWORD PTR DS:[EDI+4]
00540CB2  |. 81C3 D0010000  ADD EBX,1D0
00540CB8  |. 81FB 00016201  CMP EBX,1620100
00540CBE  |. 8938           MOV DWORD PTR DS:[EAX],EDI
00540CC0  |.^72 AE          JB SHORT SR_GameS.00540C70
00540CC2  |. B0 01          MOV AL,1
00540CC4  |. 8B4C24 1C      MOV ECX,DWORD PTR SS:[ESP+1C]
00540CC8  |. 64:890D 000000>MOV DWORD PTR FS:[0],ECX
00540CCF  |. 59             POP ECX
00540CD0  |. 5F             POP EDI
00540CD1  |. 5E             POP ESI
00540CD2  |. 5D             POP EBP
00540CD3  |. 5B             POP EBX
00540CD4  |. 83C4 14        ADD ESP,14
00540CD7  \. C2 0400        RETN 4

Regards
10/30/2024 10:10 Deja45Vu#6
Quote:
Originally Posted by hexcode View Post
Hello everyone! We have a small non-bot server that we've been supporting for the last 7 years. The server is based on BRFiles and is limited to 10D, so we're running only one Game Server, one Shard Server, and one Agent Server. We've optimized the server to handle up to 48,000 objects, but after 1-2 weeks of continuous operation without a restart, the object count rises to 49,000, causing some regions to start lagging. This happens faster when events like winter, Halloween, or Easter are active. To prevent reaching the 50k limit and to extend the time between restarts, we're trying to add a second Game Server.

The goal is to add a second Game Server while using a single IP address on the same server machine. I've patched all server modules to allow them to start on the same PC (cannot create semaphore: module already executing) and added the second Game Server and second Machine manager in certification.

However, there’s an issue: when both are running on the same IP and same machine, I can only operate one Machine Manager and one Game Server. For instance, if I start the second Machine Manager, the Global Manager throws this error: server cord already established: created session overlapped. If I bypass this error by patching the Global Manager, both Machine Managers connected , but both work as primary[102] (not [102] and [103]) and only one of them(first started) is shows as active in Global Manager diagram.How the Global manager decide which connected module is [102] and who to be [103]? Is it the wip/nip IP in srNodeType?


Running 2 Machine managers on patched Global manager
[Only registered and activated users can see links. Click Here To Register...]

I'm wondering if it's even possible to run this configuration on a single machine with the same real IP. Could the certification we’re using be the problem? In tests with one physical machine and one VM on LOCAL network (192.xxx.xxx.xxx), both Game Servers worked fine using the same certification.

Certification module in use:
[Only registered and activated users can see links. Click Here To Register...]

Certification diagram:
[Only registered and activated users can see links. Click Here To Register...]

Global Manager error (before patching) when trying to connect the second Machine Manager:
[Only registered and activated users can see links. Click Here To Register...]

Certification srNodeType config:
[Only registered and activated users can see links. Click Here To Register...]


I also tried a scenario with one physical machine using a real IP (e.g., 109.109.109.109) and a VM with a local IP (192.168.50.100), but the same problem occurs – only one Machine Manager/Game Server can be certified, with overlap errors in the Global Manager. The only solution that has worked so far is running everything in a local network (192.xxx.xxx.xxx) and redirecting ports from the external IP to the local network, but this isn’t an option right now.

Has anyone successfully made this setup work on a single machine with a single real IP?

Any hints would be greatly appreciated.


Regards
You don't have to use shared ips per node (only 1 node per ip will working well).
One of the good ways that you can do is create a virtual private network adapter with the local ips for nodes.
It will separate your modules from a public network. Then you have to use a proxy between public ips to your private ips gateway/agent.
10/30/2024 10:32 hexcode#7
Quote:
Originally Posted by Deja45Vu View Post
You don't have to use shared ips per node (only 1 node per ip will working well).
Looks why there is no any tricky solution about this. I though about some GS patch,but looks why this will not work.

Thanks for information.Probably the only way is to make server up on some of other server LAN cards or VM LAN and to redirect the ports.

Quote:
Originally Posted by Deja45Vu
Then you have to use a proxy between public ips to your private ips
@[Only registered and activated users can see links. Click Here To Register...] Is there any free simple proxy with source,just to test to redirect the Agent server because will send the local IP to the client? I will test it on separate server.

Regards
11/02/2024 21:50 Deja45Vu#8
Quote:
Originally Posted by hexcode View Post
Looks why there is no any tricky solution about this. I though about some GS patch,but looks why this will not work.

Thanks for information.Probably the only way is to make server up on some of other server LAN cards or VM LAN and to redirect the ports.

@[Only registered and activated users can see links. Click Here To Register...] Is there any free simple proxy with source,just to test to redirect the Agent server because will send the local IP to the client? I will test it on separate server.

Regards
Unfortunately dont know released filter support BR files, but you can try use a ducksoup using only A103 packet handler to override agent ip
11/04/2024 11:25 hexcode#9
Thanks. Yeah, unfortunately there is not much BR Files filters.I will try to make it work, source is needed because we dont use the standard opcodes and i must change it in the filter.

Regards
11/21/2024 16:27 hexcode#10
Quote:
Originally Posted by Deja45Vu View Post
Unfortunately dont know released filter support BR files, but you can try use a ducksoup using only A103 packet handler to override agent ip
I made a test server with 2PC ,one physical and 1 on VM

PC1
REAL IP: 109.109.109.109
LAN: 192.168.50.1

VM
LAN: 192.168.50.250

I am using a old sr proxy source code to redirect traffic from the real IP 109.109.109.109 to 192.168.50.1 to Gateway and Agent Server. Server is running normally with both game servers,but the problem is when user is login in game, the Gateway report the internal IP 192.168.50.1,not the real IP of the user.
Is this a filter issue or there is no way the Gateway to detect the real user IP if is run on local IP address?

I will try and DuckSoup filter,but probably will be the same.Its took a lot of time to rewrite the opcodes,because i am using a different opcode tables.

Regards