Sphereserver / Source

http://spherecommunity.net
Apache License 2.0
108 stars 58 forks source link

Problem to connect - server reboot needed #226

Closed FiLoUs64 closed 3 years ago

FiLoUs64 commented 4 years ago

We have a random problem with connection, sometimes all the players can't connect to the shard. You see the shard name on first screen after login, but server jam and you have the message "There is some problem communicating with Origin. Please restart Ultima Online and try again."

In console sometime there no message, only saw account log in and disconnect. Today got a critical just before the problem came.

10:11:DEBUG: thread (6696) # function ticks passed from previous function start 10:11:DEBUG:>> 6696 0 NetworkManager::processAllInput +0 10:11:DEBUG:>> 6696 1 NetworkInput::processInput +0 10:11:DEBUG:>> 6696 2 NetworkInput::processData +0 10:11:DEBUG:>> 6696 3 NetworkInput::processData +0 10:11:DEBUG:>> 6696 4 NetworkInput::processGameClientData +0 <-- exception catch point (below is guessed and could be incorrect!) 10:11:DEBUG:>> 6696 5 PacketCharPlay::onReceive +0 10:11:DEBUG:>> 6696 6 CClient::Setup_Play +0 10:11:DEBUG:>> 6696 7 CClient::Setup_Start +0 10:11:DEBUG:>> 6696 8 CClient::addPlayerStart +0 10:11:DEBUG:>> 6696 9 CChar::MoveToChar +0 10:11:DEBUG:>> 6696 10 CChar::MoveToRegion +0 10:11:DEBUG:>> 6696 11 CRegionBase::OnRegionTrigger +0 10:11:CRITICAL:"Access Violation" (0x146374), in SUB: NetworkInput::Message::ProcessMessage() 10:11:DEBUG:70:Parsing Packet len=73 id=0x5d [2019/12/30 10:11:09] 0 1 2 3 4 5 6 7 8 9 A B C D E F

0000 5d ed ed ed ed 48 61 7a 65 6c 20 6c 61 20 44 65 ]....Hazel la De 0010 6d 69 2d 45 6c 66 65 20 5b 41 6b 61 72 61 6e 5d mi-Elfe [Akaran] 0020 00 00 00 00 00 00 00 00 3f 00 00 00 00 00 00 00 ........?....... 0030 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0040 00 00 00 00 04 8b 00 a8 c0 .........

Only solution for having it work it's to restart the server.

It's very problematic right now with a live server.

Thanks for your help

coruja747 commented 4 years ago

ProcessMessage() is used to format internal messages, so probably there's a message with wrong % args on your sphere_msgs.scp. Messages must have all % args in the same sequence and these args should not be reordered/added/removed or get the type changed (%s, %d, etc) because this will make console throw this exception when it try to fill wrong args on the message

Honestly I don't think this is related to disconnect issue, but anyway, things should be better if you first fix it because sphere automatically disconnect clients causing console errors

Jhobean commented 4 years ago

Any debug we can active to test this connexion bug?

coruja747 commented 4 years ago

You can use DEBUGF_NETWORK or DEBUGF_PACKETS on sphere.ini, but these debug flags only works on debug build, which is not compiled automatically so you must follow the steps on GitHub page to compile it manually

Note that debug build doesn't optimize core functions at compiler level and it also have some extra debug stuff that will slow down server performance, so it's only recommended use debug builds for testing

coruja747 commented 4 years ago

Just to make sure, this still happening on latest build?

Jhobean commented 4 years ago

I think we found a cause of this. When we modify sphere.ini and doing a resync. Its seem to be impossible to new client to connect. All client already connect are ok

coruja747 commented 4 years ago

Sounds weird, are you changing some specific setting or it happen on any resync? I'm testing using an empty server (latest build + latest script pack + latest client 7.0.83.27) and it seems to be working fine

...
Startup complete (Items=85, Chars=5, Accounts=2)
Use '?' to view available console commands

01:14:0:Client connected [Total:1] ('127.0.0.1' 1/1)
01:14:0:Login 'test'
01:14:0:Client disconnected [Total:0] ('127.0.0.1', acct='test')
01:14:1:Client connected [Total:1] ('127.0.0.1' 1/2)
01:14:1:Login 'test'
01:14:1:Account 'test' logged on char 'Testing' ('127.0.0.1')
01:14:1:Client disconnected [Total:0] ('127.0.0.1', acct='test')
Server is being PAUSED for Resync
Resync Restart
WARNING:Resource 'sphere.ini' changed, resync.
Indexing 194 scripts...
Done loading scripts (53 of 200 triggers used)
Resync complete!
01:14:2:Client connected [Total:1] ('127.0.0.1' 1/1)
01:14:2:Login 'test'
01:14:3:Client connected [Total:2] ('127.0.0.1' 1/2)
01:14:2:Client disconnected [Total:1] ('127.0.0.1', acct='test')
01:14:3:Login 'test'
01:14:3:Account 'test' logged on char 'Testing' ('127.0.0.1')
FiLoUs64 commented 4 years ago

For example I activated this setting :

// COMBATF_ALLOWHITFROMSHIP 00040 // Allow attacking opponents from ships

and resync .ini. Player who already log in have not problem but you can't connect and have this message : "There is some problem communicating with Origin. Please restart Ultima Online and try again."

Jhobean commented 4 years ago

I changed this line and did a resync.

// Only commands issued by this plevel and higher will be logged
CommandLog=0

And a reboot was require because nobody was able to connect

image

FiLoUs64 commented 3 years ago

The problem is when you resync the ini the SERVIP going back to original value (127.0.0.1). You have to change the IP on SERVIP in ini or add this :

[FUNCTION f_onserver_timer] // This function is called periodically at every X minutes (value is defined on TimerCall setting of sphere.ini). SERVIP=youradresseip,port