Damian666 / Orion-Plus-Game-Engine

Simple 2D ORPG game engine written in VB.Net.
Other
20 stars 17 forks source link

More logging #32

Closed Krilliac closed 7 years ago

Krilliac commented 7 years ago

Might be worth to add logging around all of the server packets, like

If Buffer.ReadInteger <> ClientPackets.CPlayerMove Then Exit Sub Addlog("Recieved CMSG: CPlayerMove", PLAYER_LOG) TextAdd("Recieved CMSG: CPlayerMove")

and

PlayerMove(index, Dir, movement, False) Addlog(" Player: " & GetPlayerName(index) & " : " & " X: " & tmpX & " Y: " & tmpY & " Dir: " & Dir & " Movement: " & movement, PLAYER_LOG) TextAdd(" Player: " & GetPlayerName(index) & " : " & " X: " & tmpX & " Y: " & tmpY & " Dir: " & Dir & " Movement: " & movement)

(This was in ServerHandleData at line 649)

Edit: Since it didn't really paste correctly on GitHub i'll just add a pastebin link to it as well (Rather use this anyway)

https://pastebin.com/XN2Gf1Gh

it will look like this,

Recieved CMSG: CPlayerMove Player: test : X: 20 Y: 12 Dir: 3 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 21 Y: 12 Dir: 3 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 22 Y: 12 Dir: 1 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 22 Y: 13 Dir: 1 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 22 Y: 14 Dir: 2 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 21 Y: 14 Dir: 2 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 20 Y: 14 Dir: 0 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 20 Y: 13 Dir: 0 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 20 Y: 12 Dir: 3 Movement: 1 Recieved CMSG: CPlayerMove Player: test : X: 21 Y: 12 Dir: 3 Movement: 1

Krilliac commented 7 years ago

Also, maybe some kind of log bit mask in the server config, so you can choose on what you want logged, Like Movement logs, Pet logs, AI logs, ect

There is of course more that could go into the logging as well, like If in bank/shop, return a 1.

Damian666 commented 7 years ago

your welcome to do so, but I'm not lolz