Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase 1 Refactor of Session, NetworkSession, Action handlers #267

Closed
wants to merge 13 commits into from
Closed

Phase 1 Refactor of Session, NetworkSession, Action handlers #267

wants to merge 13 commits into from

Conversation

Zegeger
Copy link
Contributor

@Zegeger Zegeger commented Apr 21, 2017

Merged SocketManager into WorldManager
Made Session inherit from NetworkSession, flattening the model
Moved GameMessage handlers into Session class, partial classes
Moved GameAction handlers into Player class, partial classes
This move makes functionality encapsulated into these classes, allowing a move to fewer public members.
Phase 2 will be to build on WorldObject model to improve queued game actions, broadcast, and action ordering/timing.

Creature cwo = new Creature(c);
worldObjects.Add(cwo.Guid, cwo);
// Creature cwo = new Creature(c);
// worldObjects.Add(cwo.Guid, cwo);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You disabled creature spawning here. Is there another place where this is happening now, as I couldn't really find it anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted it. For some reason that section causes an Exception for me, so was easier to comment it out.

Copy link
Contributor

@Mogwai-TheFurry Mogwai-TheFurry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall...

  1. ".Objects" namespace - do not like
  2. Player class doing game action network decoding - do not like.
  3. MANY cases of file names not matching class names. In the case of partial classes, I'm a big fan of ClassName.PartialName.cs

[GameAction(GameActionType.AllegianceUpdateRequest)]
private void AllegianceUpdateRequestAction(ClientMessage message)
{
var unknown1 = message.Payload.ReadUInt32();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is bad for the Player class. The Player class, which represents a person at the keyboard playing the game, is now responsible for parsing network Game Actions? Please no.

public partial class Player
{
[GameAction(GameActionType.Suicide)]
private void CharacterSuicide(ClientMessage message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this used to work...

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

Successfully merging this pull request may close these issues.

None yet

3 participants