Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Data integrity routines #961

Closed
wzdev-ci opened this issue Sep 27, 2009 · 15 comments
Closed

Data integrity routines #961

wzdev-ci opened this issue Sep 27, 2009 · 15 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_patch (an actual patch, not a request for one) | by Buginator


This is the start of data checking.

Currently, it will only work on platform specific systems. So windows <-> windows, or linux <-> linux but not windows <-> linux.

The reason for this is the current data in the SVN needs to have the EOL set to the same for all platforms--see ML for more details. This could either be CR (mac?) CRLF (windows) LF (linux).

I think it should be set to CRLF since most all utilities are windows based, and those require CRLF to work.

On to the routine. In simple terms, it throws the buffer to the hash routine, and calculates it.
Then when people enter the game, it will kick people out if the data does not match.

A) I don't think we should parse the buffer to strip \r\n (or \r or \n...) just takes up more code and can be easily solved by changing the EOL style on SVN to CRLF.

B) There is a log message for when it kicks you, but you will be dumped back to the main menu. It is the same as if you pressed quit while in-game.

C) This is only phase one of the data integrity routines, more advanced routines are planned. This is mainly meant so people with different mods can't play together, since that tends to screw up games.

D) I am not 100% sure of the endian issues, I think I got them all, but if someone can double check...


Issue migrated from trac:961 at 2022-04-15 19:17:20 -0700

@wzdev-ci
Copy link
Contributor Author

Buginator uploaded file CRLFstyle.patch (204.0 KiB)

Does NOT apply, it just shows changes...

@wzdev-ci
Copy link
Contributor Author

Buginator uploaded file dataintegrity.patch (18.6 KiB)

@wzdev-ci
Copy link
Contributor Author

Buginator commented


Yes, still needs to be cleaned up a bit.

@wzdev-ci
Copy link
Contributor Author

Giel commented


Regarding your problems with [2531] and [2532]. If what you where attempting to do is to hash the binary contents of SCRIPT and SCRIPTVAL files, I suggest you don't. Instead I would suggest that you hash the AST created as a result of parsing these files as that's both more accurate and resilient to CRLF/LF/CR differences (not to mention it allows different comments, etc.).

@wzdev-ci
Copy link
Contributor Author

Giel commented


Also why would you use CRLF as line ending and not LF? ;-)

@wzdev-ci
Copy link
Contributor Author

Kreuvf commented


The data integrity routines aim at comparing "my files" with the files B claims to have, right?

And I am for using a line ending that eats one byte only. ;)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator changed status from new to accepted

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator changed owner from `` to Buginator

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator commented


OK fine, I redid the detection routines, and now, it doesn't care if it is CR / CRLF / or LF. Happy now? :P

Replying to Warzone2100/old-trac-import#961 (comment:4):

The data integrity routines aim at comparing "my files" with the files B claims to have, right?

And I am for using a line ending that eats one byte only. ;)

Yes, that is what it does. If Host is running a mod, and players are not, it kicks players. If Host is not running a mod and players are, then it kicks the players that don't match the Host's data.

This was done in [8205] & [8206]

Trunk version will be done a bit later, when I get more time.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator commented


BTW, I still have to find a better way to handle kicks, since it drops you into the main menu. The same thing happens when you 'quit' a MP game.

There is a kick message in the logs, and there is a kick message broadcast to all remaining players though.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator changed status from accepted to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator set resolution to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Oct 4, 2009

Buginator commented


(In [8213]) Data Integrity is reimplemented. Version string has been updated, so the new data checks can work correctly.

If all players do not run the same mods or have the same data as the HOST, then they will be kicked. This is done to prevent crashes to the game.

Closes #961

@wzdev-ci wzdev-ci closed this as completed Oct 4, 2009
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented May 8, 2010

Buginator removed milestone (was 2.2.4)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented May 8, 2010

Buginator commented


Milestone 2.2.4 deleted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant