Mirage Source

Free ORPG making software.
It is currently Tue Apr 16, 2024 3:11 pm

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1833 posts ]  Go to page 1, 2, 3, 4, 5 ... 74  Next
Author Message
PostPosted: Wed Apr 08, 2009 1:01 am 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
Ok so I am just going to port over the code I used for firecaster (the closed beta version of which has lagless and completely secure movement). Hopefully you all can follow along with what I am doing.

All of this should be serverside (hopefully)

First add these values to tempplayerrec
Code:
    MovesLeft As Byte
    MovesRight As Byte
    MovesUp As Byte
    MovesDown As Byte
    CanMoveWhen As Long

They will come into use later, but you might as well do them all at once.

At the bottom of modServerLoop add
Code:
Private Sub UpdatePlayerMovement()
Dim i As Integer
    For i = 1 To High_Index
        With TempPlayer(i)
            If .CanMoveWhen <> 0 Then
                .CanMoveWhen = .CanMoveWhen - 1
                If .CanMoveWhen = 0 Then
                    If .MovesDown > 0 Then
                        Call PlayerMove(i, DIR_DOWN, MOVING_RUNNING)
                        .MovesDown = .MovesDown - 1
                    ElseIf .MovesUp > 0 Then
                        Call PlayerMove(i, DIR_UP, MOVING_RUNNING)
                        .MovesUp = .MovesUp - 1
                    ElseIf .MovesLeft > 0 Then
                        Call PlayerMove(i, DIR_LEFT, MOVING_RUNNING)
                        .MovesLeft = .MovesLeft - 1
                    ElseIf .MovesRight > 0 Then
                        Call PlayerMove(i, DIR_RIGHT, MOVING_RUNNING)
                        .MovesRight = .MovesRight - 1
                    End If
                End If
            End If
        End With
    Next i
End Sub



In sub ServerLoop under
Code:
Dim LastUpdatePlayerVitals As Long

add
Code:
Dim LastUpdatePlayerMovement As Long


under
Code:
        ' Checks to save players every 10 minutes - Can be tweaked
        If Tick > LastUpdateSavePlayers Then
            UpdateSavePlayers
            LastUpdateSavePlayers = GetTickCount + 600000
        End If

Put
Code:
        If Tick > LastUpdatePlayerMovement Then
            UpdatePlayerMovement
            LastUpdatePlayerMovement = GetTickCount + 30
        End If


The 30 value corresponds to the walktimer section of the client. If you don't know what that is, then do not change the 30.

Now in sub PlayerMove
under
Code:
    ' Check for subscript out of range
    If IsPlaying(Index) = False Or Dir < DIR_UP Or Dir > DIR_RIGHT Or Movement < 1 Or Movement > 2 Then
        Exit Sub
    End If

put
Code:
    If TempPlayer(Index).CanMoveWhen > 0 Then
        If Dir = DIR_RIGHT Then TempPlayer(Index).MovesRight = TempPlayer(Index).MovesRight + 1
        If Dir = DIR_DOWN Then TempPlayer(Index).MovesDown = TempPlayer(Index).MovesDown + 1
        If Dir = DIR_LEFT Then TempPlayer(Index).MovesLeft = TempPlayer(Index).MovesLeft + 1
        If Dir = DIR_UP Then TempPlayer(Index).MovesUp = TempPlayer(Index).MovesUp + 1
        Exit Sub
    End If
    'lets set their movement timer
    TempPlayer(Index).CanMoveWhen = 4

The 4 is gotten by dividing the tile size, 32, by the runspeed (we use run speed to give players the benefit of the doubt) which by default is 8
32/8=4

This code is currently being tested, but if you can find bugs before I do that would be greatly appreciated.

Ok put this last fix and it should be good
find
Code:
Call HackingAttempt(Index, "Position Modification")

replace it with
Code:
Call SendPlayerXY(Index)

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Last edited by Labmonkey on Thu Apr 09, 2009 7:29 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Apr 08, 2009 11:58 am 
Offline
Knowledgeable

Joined: Sun Jul 29, 2007 12:23 am
Posts: 199
So this will pretty much stop users from using that "Cheat Engine".. :)


Top
 Profile  
 
PostPosted: Wed Apr 08, 2009 3:33 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
Yes.


Ok, so before you test this and say it doesn't work, let me explain what the results should look like.

If a person is speedhacking, it will look like to them they are speedhacking! But if you log on twice to the server, the other person (not speedhacking) will see the person moving normally. If you walk in front of someone speedhacking, they will probably also get booted for position modification ;).

Currently there is a problem where some people also get booted while running. I am fixing it currently.



EDIT: Ok, for everyone that wants to use this here is a temporary (maybe permanent) fix.

Find
Code:
        Call HackingAttempt(Index, "Position Modification")

and replace it with
Code:
        Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 2:11 pm 
Offline
Newbie
User avatar

Joined: Thu Mar 19, 2009 8:30 pm
Posts: 19
this is brilliant i love it xD


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 2:18 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Labmonkey wrote:
Yes.


Ok, so before you test this and say it doesn't work, let me explain what the results should look like.

If a person is speedhacking, it will look like to them they are speedhacking! But if you log on twice to the server, the other person (not speedhacking) will see the person moving normally. If you walk in front of someone speedhacking, they will probably also get booted for position modification ;).

Currently there is a problem where some people also get booted while running. I am fixing it currently.



EDIT: Ok, for everyone that wants to use this here is a temporary (maybe permanent) fix.

Find
Code:
        Call HackingAttempt(Index, "Position Modification")

and replace it with
Code:
        Call PlayerWarp(Index, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))


PlayerWarp is a cheap fix. Set up a new function that sets the client's position without re-sending all the data to everyone. If that's your idea of a 'permanent fix' then you're very silly.

You should edit the server timer to take into account the obvious fluctations in connection speed and reliability.

Also, moved to the tutorial section.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 6:14 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
The playerwarp, if you notice, says temporary.

The server timer is fine being exact, as nothing bad happens if it catches you "speed hacking". Even if two packets come in close together, the server will still move you the same, and the client (if it isn't actually hacking) will also move you the same, and everything will be in sync.

Yes, I am going to change the update packet, but I left right after I made this tutorial, so if you needed to stop speedhacking you could use it as a semi-permanent fix and nothing terribly bad would happen.




Also, why was this moved? Isn't the section I put it in for bug-fixes? I would not really call this a feature.

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 6:40 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Labmonkey wrote:
The playerwarp, if you notice, says temporary.


Labmonkey wrote:
(maybe permanent)


Labmonkey wrote:
Also, why was this moved? Isn't the section I put it in for bug-fixes? I would not really call this a feature.


Because it's not fixing a bug. It's a feature which prevents speed hacking.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 7:18 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
Quote:
so if you needed to stop speedhacking you could use it as a semi-permanent fix and nothing terribly bad would happen.


Stop selective reading.


My game has so many featuers! You can't speedhack, or crash the server, or steal my bank account number, or make my computer explode, or shut down google.com, or accidentally install chaos engine with it! Don't you want to play it :D.


Anyway, it doesn't really matter. I should have the new packet thing up in a few minutes.

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 7:24 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Labmonkey wrote:
My game has so many featuers! You can't speedhack, or crash the server, or steal my bank account number, or make my computer explode, or shut down google.com, or accidentally install chaos engine with it! Don't you want to play it :D.


You're mixing up the features of the game, and the features of the engine.

If your game didn't have packet sanitisation then a lot of people wouldn't play your game, as it'd be down half the time if OGCore's community is anything to go by.

You might not want to advertise the features which you added to the core engine, but without them your game would a be a lot worse.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 7:30 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
It depends on your definition of feature, if you want to continue the argument you can get on msn or something, but otherwise i think we should just let it die. :mrgreen:

Anyway, I put up the fix in the main post. Apparently ms4 has a sendplayerxy function. Cool.

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 7:37 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Labmonkey wrote:
It depends on your definition of feature


I tend to use the actual definition of words, rather than making up my own. ;D

But I'll drop the subject. Have fun working on the feature.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 7:51 pm 
Stopping any form of hack isn't a feature, nor is it a bug fix. It'd vote it more of an optimization than anything.

*shrugs*


Top
  
 
PostPosted: Thu Apr 09, 2009 8:06 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
We use to have a security section...

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 8:12 pm 
Labmonkey wrote:
We use to have a security section...


Yeah. Security is def where this belongs.


Top
  
 
PostPosted: Thu Apr 09, 2009 8:16 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
I have to agree. After all, I suggested to Shan the security section way back. I think that's what led me to getting moderator status :P

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 8:17 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
The problem with those sections, there weren't that many posts. I would just tag the thread title like "[Security] Title".


Top
 Profile  
 
PostPosted: Thu Apr 09, 2009 8:19 pm 
Dugor wrote:
The problem with those sections, there weren't that many posts. I would just tag the thread title like "[Security] Title".


Not a bad idea.


Top
  
 
PostPosted: Thu Apr 09, 2009 9:11 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
True that.

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Fri Apr 10, 2009 1:36 pm 
Offline
Knowledgeable

Joined: Sat Jul 08, 2006 8:24 am
Posts: 339
Isn't my g15 keyboard a much greater threat than speedhacking? I was able to level a bit overnight using mah keyboard on James's game.


Top
 Profile  
 
PostPosted: Fri Apr 10, 2009 2:40 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
Yes, botting is also a theat, but that has to do with the way your game is structured. It is very easy to bot a mindless game, one where monsters dont damage you, and levels are based on how much time you spend grinding. It is much harder to bot games where monsters actually hurt you, and grind is minimum. Games like that are also more fun ;).


But I don't see what any of this has to do with speedhacking. It was a major problem, and I fixed it. If you want to make a new topic on botting then go ahead.

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Wed Dec 01, 2021 8:45 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 475347
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
PostPosted: Mon Jan 03, 2022 10:25 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 475347
Econ


Top
 Profile  
 
PostPosted: Mon Jan 03, 2022 10:27 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 475347
87.1


Top
 Profile  
 
PostPosted: Mon Jan 03, 2022 10:28 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 475347
Bett


Top
 Profile  
 
PostPosted: Mon Jan 03, 2022 10:29 am 
Online
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 475347
Bett


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1833 posts ]  Go to page 1, 2, 3, 4, 5 ... 74  Next

All times are UTC


Who is online

Users browsing this forum: wanai and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group