Jump to content
SSForum.net is back!

Recommended Posts

  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Posted

http://img.photobucket.com/albums/v622/bak2007/disc_tease_6_26_09.png

 

I'm pretty sure I just finished the client-side anti-cheat. It basically records all interesting events into a log that it can replay to make sure the reported state matches the calculated state. All that's left now is for the server to make sure that the reported state (position packets) in the log correspond to actual packets the server got/sent, as well as actually replaying the log (either on another machine or on the server, not sure yet). Here's the list of interesting events it records:

 

enum EventType
{
TYPE_SHIP_CHANGE, // player changed his ship
TYPE_NEW_KEY_STATE, // player pressed / released some keys
TYPE_TICK, // advance time
TYPE_SENT_POSITION_PACKET, // position packet sent
TYPE_TIMER_SYNC, // server <-> client timer synchronization
TYPE_SHIP_CHANGE_REQUEST, // player requested ship change
TYPE_OTHER_PLAYER_ENTERING,
TYPE_OTHER_PLAYER_LEAVING,
TYPE_OTHER_PLAYER_CHANGE_SHIP,
TYPE_OTHER_PLAYER_CHANGE_FREQ,
TYPE_OTHER_PLAYER_POSITION,
TYPE_OTHER_PLAYER_WEAPON,
TYPE_FREQ_CHANGE,
TYPE_SELF_DIED,
TYPE_OTHER_PLAYER_DIED,
};

  • 5 weeks later...
  • 4 months later...
Posted

when I start a project initially it's like 75% coding, 25% debugging...

 

with a project like Discretion it's like 20% planning, 50% reviewing code to make sure assumptions are correct, 10% coding, 10% debugging, and 10% undoing work that I thought was correct but turned out to be misunderstood assumptions about earlier code

 

I suspect this is not abnormal. Are there solutions?

  • 1 year later...
  • 2 weeks later...
Posted

Have you thought about client side scripting? I would think Mozilla SpiderMonkey (ECMAScript / JavaScript) is well suited for that purpose (used internally by firefox and flash). V8 seems like a good choice too (written by a guy named Lars Bak, hah)

 

It is perfect for making sure servers can not use nasty code.

Posted
It's pretty easy to embed the mono interpreter as well

_UU___UU__SSSSS____AAA____UU___UU__SSSSS____AAA___

_UU___UU_SS_______AAAAA___UU___UU_SS_______AAAAA__

_UU___UU__SSSSS__AA___AA__UU___UU__SSSSS__AA___AA_

_UU___UU______SS_AAAAAAA__UU___UU______SS_AAAAAAA_

__UUUUU___SSSSS_AA____AA___UUUUU___SSSSS_AA____AA

J.C. Dento> prime example of why america will never be a world super power.

Moscato> d1 is mad he will never have a job outside subspace

I can't see this because I turned signatures off. ps VT

Posted
i hear mono is good

SSC Distension Owner
SSCU Trench Wars Developer


3:JabJabJab> sometimes i feel like when im in this mood im like a productive form of Cheese
Dr Brain> Pretty much everything you said was wrong. Except where you called me a lazy jerk with no time. That was true.
3:KrynetiX> do you ever open your web browser and type ?go google
5:Ceiu> Wow. My colon decided that was a good time to evacuate itself.

Posted
I think there was talk of some sort of signing to run native code? Remember, even a scripting environment doesn't completely eliminate risk. Ideally, even client side scripts would be signed.
Posted
they have a pretty good sandbox setup for moonlight (their silverlight implementation) so you could probably use that if you were worried

_UU___UU__SSSSS____AAA____UU___UU__SSSSS____AAA___

_UU___UU_SS_______AAAAA___UU___UU_SS_______AAAAA__

_UU___UU__SSSSS__AA___AA__UU___UU__SSSSS__AA___AA_

_UU___UU______SS_AAAAAAA__UU___UU______SS_AAAAAAA_

__UUUUU___SSSSS_AA____AA___UUUUU___SSSSS_AA____AA

J.C. Dento> prime example of why america will never be a world super power.

Moscato> d1 is mad he will never have a job outside subspace

I can't see this because I turned signatures off. ps VT

Posted

this is why I suggest spidermonkey. it is used by firefox for web applications. finding an exploit is very hard (and if you do, you can get $3000 for reporting it). As long as the API does not expose anything dangerous i would say it is very secure. You could still add a sandbox to prevent any exploits going up to the OS (like chrome does).

 

Having to sign client side scripts seems incredible frustrating to me.

Posted

I was not thinking along the lines of a server delivered module that introduces entirely new functionality (for example joystick support). But intended it to offload all the hackery that is normally done on the server using lvz to the client.

A good example would be a graphical interface for a store such as in hyperspace (page flipping, page scrolling, resource cost, item descriptions, fancy pictures, etc). Using the current lvz system this is very inefficient and annoying to build. With simple scripting this works a lot better.

For such tasks, the signed module method seems horrible.

Posted
I personally think that signing should be used throughout the protocol. Everything could benefit from this, the biller, the game server, the client. Even the directory server might have some minor benefits.
Freedom is the right to be wrong.
  • 1 year later...
Posted

Worked on getting the new digital signing in. I figured I would work on the automatic updater first, so that's where I started. Apparently the people at zlib have got a few more newer versions of the library out, but they no longer release pre-built binaries, just the source code, which is bad for windows. They also decided to delete the .zip files of the old versions off their server, so I had to scramble before I found a version in the libpng sourceforge page.

 

Also, looking at the automatic updates, it was off a windows batch script and then a lot of hardcoded paths... not very well designed. I am redoing a lot of it now to have a much cleaner design (hopefully). It will use a regular bash script to do all the work, and then the main program shouldn't need so many hardcoded things.

  • 7 months later...
Posted

Debugging for the last two days (not my intention, but I found a bug which needed to be fixed). Here are the symptoms: crashes (segfault) occur at random after some time. gdb indicates this happens usually in 3 different places, but sometimes happens elsewhere.

 

No much to go on. I tried the standard things, using debug symbols and seeing where it was crashing using gdb to infer the error. However, it would happen in the most innocent places, and behavior would be unbelievable.

 

After further investigation (meaning hours and hours of hitting my head against the desk), I realized it only happened after I fired bombs. Not guns, but bombs. The code is almost exactly the same, save for the different animation and different settings. Why did this matter?

 

 

 

I had added this feature recently (meaning a year ago), where particles (bombs had it enabled) could have 'targeters', essentially like a trial showing you where the bomb was going so that you could potentially dodge it. This was all well and nice and seemed to work well. It was implemented as basically whenever a bomb was fired it would create another particle from the same spot with an existing time of (fired time - 1000ms), so that it would appear 1000ms ahead of where the bomb was. This worked well. When the bomb hit something, though I needed a way to make sure the targeter particle also stopped being drawn, since if they were by themselves it would be strange. So I added a pointer to the targeter inside the particle struct. Then if the particle was hit I did:

 

 

 

if (p->targeter)
   p->targeter->millisecondsLeftAlive = 0; // will delete it almost immediately

 

 
What I didn't take into account was that the targeter might expire before the particle did, so that this had the effect of writing 0 to freed memory, which on occasion was already allocated elsewhere for some purpose. This explains random crashes in many places which make no sense.
 
anyways, I'm EXTREMELY frustrated at this, but glad to have found it. The lesson is when you debug memory corruption, you can't look backwards from the results (start with the crashing location and work your way back, which I spent many hours doing). You need to instead forwards: figure out how to reproduce the problem and start commenting out code until it goes away, then comment out less and less until you find the culprit lines.

×
×
  • Create New...