Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Fixed Subbill No more high CPU stress, always 0% CPU Usage.

 
Post new topic   Reply to topic Printable version
 View previous topic  ssbilling2 for linux (ported) Post :: Post Fixed SSME (Subspace Map Editor) (Stil...  View next topic  
Author Message
fatrolls
Novice


Age:29
Gender:Gender:Male
Joined: Jul 25 2013
Posts: 35
Offline

PostPosted: Mon Apr 07, 2014 7:12 pm    Post subject: Fixed Subbill No more high CPU stress, always 0% CPU Usage. Reply to topic Reply with quote

Patched Subbill.exe v0.23
Patched offset 0x00000B53 from 0x00 to 0x0A

Seems I reverted it back to Original Subbill before someone patched it before me to 0x00

Which just changes
Sleep(0);
to
Sleep(10);

Why would you want to Sleep for 0 anyways it doesn't do anything afaik.

Takes about 2,4 Megs of Memory not too bad.
Also did you know that the original Subbill is pretty good to use as permanent solution could support over millions of logins without storing them in one risky file User.dat,

All you have to enable is ODBC data source which connects to SQL Server. (I think it's Microsoft SQL Server).

Has SQL commands such as
Code: Show/Hide

INSERT INTO Usage (ServerID,PlayerCount,UsageStamp) VALUES (%d,%d,%s)
INSERT INTO Usage (ServerID,PlayerCount,UsageStamp) VALUES (0,%d,%s)
UPDATE Users SET Banner='%s' WHERE UserID=%d
INSERT INTO Security (UserID,ServerID,MessageText,MessageTime) VALUES (-1,%d,'%s',%s)
INSERT INTO Security (UserID,ServerID,MessageText,MessageTime) VALUES (%d,%d,'%s',%s)
INSERT INTO Messages (FromUserID,ToUserID,ServerID,MessageText,MessageTime) VALUES (%d,%d,%d,'%s',%s)
UPDATE Users SET Squad='%s' WHERE UserID=%d
INSERT INTO Squads (SquadName,SquadPassword,SquadCreatorID) VALUES ('%s','%s',%d)
UPDATE Users SET Squad='' WHERE UserID=%d
UPDATE Users SET Squad='' WHERE Squad='%s'
DELETE FROM Squads WHERE SquadName='%s'
UPDATE Users SET Squad='' WHERE Alias='%s' AND Squad='%s'
UPDATE Squads SET SquadPassword='%s' WHERE SquadName='%s'
UPDATE Users SET Password='%s' WHERE UserID=%d


There is 2 SQL Procdures (Which may be hard to recreate.)
Code: Show/Hide

EXECUTE StandardUserLogOut @pUserID=%d,@pDeltaSeconds=%d,@pLastMachineID=%d,@pLastTimeZoneBias=%d,@pLastIP='%s',@pServerID=%d,@pReason=%d,@pPacketLossS2C=%d,@pPacketLossC2S=%d,@pPing=%d,@pLatency=%d,@pZoneData=0x%sFF,@pScoreID=%d

EXECUTE StandardScoreUpdate @pZoneData=0x%sFF,@pScoreID=%d,@pUserID=%d


Seems the sql files were either lost or never got transfered from Virgin Entertainment.

It contains for squad commands the message *UNKNOWN* which is the same as in SSC makes me think SSC Biller is just a patched Subbill for SSC Billing server.




Fixed Subbill v0.23 by FatRolls,
Only One Patch on this one nothing else.

Subbill.zip - 46.38 KB
File downloaded or viewed 15 time(s)
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1004
Offline

PostPosted: Mon Apr 07, 2014 8:36 pm    Post subject: Reply to topic Reply with quote

1) who are u
2) how long have u played this game
3) why do u seem to know what you are doing
4) why do u have a compulsive disorder of some kind
_________________
SSC Distension Owner
SSCU Trench Wars Developer
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
fatrolls
Novice


Age:29
Gender:Gender:Male
Joined: Jul 25 2013
Posts: 35
Offline

PostPosted: Mon Apr 07, 2014 9:52 pm    Post subject: Reply to topic Reply with quote

I like perfecting things as far as I can. You know who I am I seen you on distension in tw. I usually played/hanged out in EG since 2001 I even got my name on some of the bases I made there ages ago in EG.

Other then that I'm just trying to help out
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1004
Offline

PostPosted: Tue Apr 08, 2014 1:53 am    Post subject: Reply to topic Reply with quote

well i hope u are legit because u seem to know what u are doing
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1004
Offline

PostPosted: Tue Apr 08, 2014 5:33 pm    Post subject: Reply to topic Reply with quote

if you ever start working on subgame:

an extremely huge problem with subgame is that there is a traffic limiter that crashes the zone if a sysop sends commands too quickly

talk to jabjabjab ingame for extra info, he thinks he found a hex offset or something awhile back
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
cycad
Novice


Gender:Gender:Male
Joined: Feb 12 2004
Posts: 29
Offline

PostPosted: Thu Apr 10, 2014 12:12 am    Post subject: Reply to topic Reply with quote

fatrolls wrote:
Why would you want to Sleep for 0 anyways it doesn't do anything afaik.

It's a thread yield.

fatrolls wrote:
It contains for squad commands the message *UNKNOWN* which is the same as in SSC makes me think SSC Biller is just a patched Subbill for SSC Billing server.

Probably, I have 0x407DC0 labelled as ODBC_ExecuteQuery, which in the binary we have returns 0. PriitK probably patched it to execute the query. He also probably patched 0x407DB0 to initialize the database and database connection, which I labelled as ODBC_Connect. These functions belong to an ODBC class, which contains other related functions.

In the build we have, preprocessor options were probably defined to prevent generation of the ODBC function bodies.

Who knows what other pieces are incomplete or missing, though.
Back to top
View users profile Send private message Add User to Ignore List
cycad
Novice


Gender:Gender:Male
Joined: Feb 12 2004
Posts: 29
Offline

PostPosted: Thu Apr 10, 2014 12:26 am    Post subject: Reply to topic Reply with quote

Cheese wrote:
if you ever start working on subgame:

an extremely huge problem with subgame is that there is a traffic limiter that crashes the zone if a sysop sends commands too quickly

This is pretty easy to patch, such as at https://github.com/cycad/SubGame-Addon, but the real issue is that PriitK is unwilling/unresponsive to using any patched server (or client for that matter). This unfortunately leads to patches having no impact.
Back to top
View users profile Send private message Add User to Ignore List
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2579
Location: USA
Offline

PostPosted: Thu Apr 10, 2014 8:16 am    Post subject: Reply to topic Reply with quote

cycad wrote:
[..]


This is pretty easy to patch, such as at https://github.com/cycad/SubGame-Addon, but the real issue is that PriitK is unwilling/unresponsive to using any patched server (or client for that matter). This unfortunately leads to patches having no impact.


I remember working with this when you sent it to me a while ago but I guess I was looking to see if it was possible for more call backs to be added for all the game events (detect if a player dies, spawns, moves, etc). Conceptually this is interesting but not knowing asm to know how to further expand on it (or if it's even possible) leaves it to very limited use?
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
cycad
Novice


Gender:Gender:Male
Joined: Feb 12 2004
Posts: 29
Offline

PostPosted: Thu Apr 10, 2014 3:28 pm    Post subject: Reply to topic Reply with quote

CypherJF wrote:
I remember working with this when you sent it to me a while ago but I guess I was looking to see if it was possible for more call backs to be added for all the game events (detect if a player dies, spawns, moves, etc). Conceptually this is interesting but not knowing asm to know how to further expand on it (or if it's even possible) leaves it to very limited use?

I don't want to threadjack but yes, adding hooks anywhere takes some specialized knowledge. Needed hooks can be added by me or other reversers fairly easily, which could then be exported cleanly to plugins via the API, found in libaddon.hpp. There's only a few events but many others could be added quickly. I've reversed large portions of subgame2.exe off and on over the last 8 years or so. Based on that reversing work it's easy to make patches since it provides the roadmap to what is going on in the binary's assembly. If you don't have a roadmap adding hooks is an impossibility.

At this point with modern tools I wouldn't be surprised if it were entirely possible to decompile the original binaries into assembly-based projects, which at that point relevant portions of code could be rewritten by hand in C, or even decompiled automatically with tools like Hex-Rays.

This could be done with for the biller or even the client, too. I'll post more on this in another thread.
Back to top
View users profile Send private message Add User to Ignore List
fatrolls
Novice


Age:29
Gender:Gender:Male
Joined: Jul 25 2013
Posts: 35
Offline

PostPosted: Thu Apr 10, 2014 10:06 pm    Post subject: Reply to topic Reply with quote

cycad wrote:
It's a thread yield.


Haha a thread yield you say? using a simple Sleep call how does that work? Either way whatever it's purpose it keeps CPU in high usage, have you figured out a way around patching just maybe a missing INI settings or some command line parameter the prevents the CPU from spiking? I don't think they would of used these biller servers if they made the CPU burn like this or maybe it ran differently/just right on slow windows 95 computers.

Haha as far as bragging goes i'm one of the few people that actually have a rare pdb files for subgame and subbill, although they are old dated with Nov,10,1997 and seem to not match properly in some areas they still give a good insight funny story how I found em I used to be using altavista as my search engine I was looking for what everyone was talking about back then Twister and I found some site back then I remember it had a bunch of zone settings in one file as well as twister in another file and other file were just server+biller repack of some sort and to my surprise I didn't understand what those pdb files did back then but I kept it all, the files themselves seem useless for continuum though. If you are lucky enough to figure out the website you maybe able to get them from archive.org
Back to top
View users profile Send private message Add User to Ignore List
fatrolls
Novice


Age:29
Gender:Gender:Male
Joined: Jul 25 2013
Posts: 35
Offline

PostPosted: Sat Apr 26, 2014 12:18 pm    Post subject: Reply to topic Reply with quote

I'd like to correct you on thread yield idea you had cycad.

subgame and subbill were both made for Windows 95 this is back when threads / threading didn't even exist they did have multi-tasking though.

The way subgame seems to be completely single threaded the Sleep(0); was probably required for Windows 95 multi-tasking so the application doesn't hog the whole system up. Kinda like DoEvents() in Visual Basic I think.

There is no CreateThread API's and yeah that api only existed since Windows XP.

It also spawns other programs in the background like tracert and has the ability to spawn itself for multiple zones and to just run remote tools.

Such as this example:
In a batch file type

Code: Show/Hide

subgame2 /SPAWN notepad


you could use that to open notepad using subgame2

/SPAWN command runs cmd.exe or command.com whichever your OS supports with a /c flag

I don't think the /SPAWN command was used for anything else then spawning other subgame servers.

you could use

Code: Show/Hide

subgame2 /SPAWN subgame2


this will spawn 2 subgame2 servers in one command prompt probably not to have too much command prompt windows on the screen, it will still run 2 processes.

I was thinking that subgame2 was like httpd (apache) where it spawns a bunch of processes of itself for multiple connections, but that will have a hard time synchronizing stuff only thing it spawns is the tracert program which is used for the command *trace

Also I wonder I'm checking out the Subspace CD server files and I can't seem to find the tracert.exe executable even though the command exists in the subgame.exe I guess they forgot to include it and everytime someone did the trace command the subgame.exe would crash haha.

Seems the official tracert.exe was never leaked and was remade by PriitK luckily it doesn't seem too important biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1004
Offline

PostPosted: Sat Apr 26, 2014 6:46 pm    Post subject: Reply to topic Reply with quote

is it possible whatever compiler he was using saw the 0 in sleep(0) and optimized away the entire thing because 0 < 1
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
cycad
Novice


Gender:Gender:Male
Joined: Feb 12 2004
Posts: 29
Offline

PostPosted: Tue Apr 29, 2014 9:08 am    Post subject: Reply to topic Reply with quote

Sleep(0) being a yield is documented behavior of the API call, I'm not sure why you think it's an "idea" I had. CreateThread and threading both existed in Windows 95.

tracert.exe is a program for tracing network hops that comes standard with Windows.
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Misc User Apps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 51 page(s) served in previous 5 minutes.

phpBB Created this page in 0.120394 seconds : 40 queries executed (10.2%): GZIP compression disabled