RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Fix for disconnect showing 1 too many users online.

Status
Not open for further replies.

jjarmis

Wanderer
Fix for disconnect showing 1 too many users online.

I have noticed that when a user disconnects from the shard it always shows 1 more user online than there is after the disconnect. This is an easy fix:

On line 721 and 723 in Netstate.cs (from the core) is where these messages are displayed. Replace this:

Code:
if ( ns.m_Account != null )
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online] [{2}]", ns, m_Instances.Count, ns.m_Account );
else
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online]", ns, m_Instances.Count );

With this:

Code:
if ( ns.m_Account != null )
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online] [{2}]", ns, (m_Instances.Count - 1), ns.m_Account );
else
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online]", ns, (m_Instances.Count - 1) );
 

stooge

Wanderer
jjarmis said:
I have noticed that when a user disconnects from the shard it always shows 1 more user online than there is after the disconnect. This is an easy fix:

On line 721 and 723 in Netstate.cs (from the core) is where these messages are displayed. Replace this:

Code:
if ( ns.m_Account != null )
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online] [{2}]", ns, m_Instances.Count, ns.m_Account );
else
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online]", ns, m_Instances.Count );

With this:

Code:
if ( ns.m_Account != null )
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online] [{2}]", ns, (m_Instances.Count - 1), ns.m_Account );
else
	Console.WriteLine( "Client: {0}: Disconnected. [{1} Online]", ns, (m_Instances.Count - 1) );
I was having the same issue. I haven't really had a chance to mess around with the core. I'll figure out how to edit my Core later tonight. In the meanwhile, I'd like to know if this issue is causing any damage to my server or any other files? In other words does it need ot be fixed ASAP or can it wait until I have more time to read up on core modifications?
 

Khaz

Knight
What jjarmis posted is the fix for it. It's clearly not damaging, but it's a nuisance that's easily solvable.
 

stooge

Wanderer
Khaz said:
What jjarmis posted is the fix for it. It's clearly not damaging, but it's a nuisance that's easily solvable.
I understand that that is the fix. I misunderstood when he said "core" fix. I actually thought I'd have to download the open source of the core and edit somethg there. :eek: I can't find NetState.cs in my RunUO folder. I did a search.

Edit:
I downloaded the Source Code and unzipped it and found NetState.cs. of course.
Now it's time for me to read up on how to edit/recompile it all after I make the fix.
Thanks again.
 

Quantos

Lord
It's a violation of the EULA for anyone to send you the files. You are better off waiting for the next release if you (like some of us) don't want to recompile the core.
 

sidphoenix

Wanderer
Wow, quick to jump down my throat are we? If I knew a moderator would get pissy about people sending me files, I wouldnt of brought it up. But hey, how can you make sure nobody sends me files? I mean, cant someone IM me and send it to me from there?

Just a thought.
 

jjarmis

Wanderer
That is like asking how software companies can stop people from pirating their software. Just because it is easy to do doesn't mean it isn't illegal.
 

sidphoenix

Wanderer
Well I am just saying, why is it illegal to have someone edit the core for me and send me the update? It would just be helping me out. Its not like hes giving me $1,000 worth the software here....
 

jjarmis

Wanderer
Because it is against the EULA read it, live by it, and you wont get sued. ^_^ Just because the program is free for you to use doesn't mean it is free for you to do whatever you want with.
 

sidphoenix

Wanderer
So let me get this straight. I (myself) can make changes, but nobody can make changes and give me the updated changes?
 

sidphoenix

Wanderer
Well hes not redistributing it to me, im sending the core to someone, the other person will make the change and give it back. Its not distribution, its editing it. I wouldnt be giving it to others...
 

sidphoenix

Wanderer
Okay, say that I hire someone to my shard, and give him FTP access to my folder that has the core. Technically hes not downloading the core, hes updating the files on my computer though FTP. Or, if he uses a program like AnywherePC and uses my screen to make changes. Technically thats "legal" isnt it?
 
Status
Not open for further replies.
Top