I have a simple question... I would like to be able to have a common base class for my rooms, since there are many operations that are similar. However, if I attempt to add a class between my Game and my Room, PlayerIO complains.
Here is what I'm trying to do (Player is a BasePlayer):
- Code: Select all
public class Room<P> : Game<P> where P : Player, new() {
protected void Kick(Player player, string reason) {
player.Kick(reason);
// Give the client a half second to disconnect, if they don't then force it
ScheduleCallback(() => {
if (player.CurrentState != Player.State.Left) {
player.Disconnect();
}
}, 500);
}
}
In my game room I would do:
- Code: Select all
[RoomType("SomeRoom")]
public class GameRoom : Room<Player> {
}
As you can see the issue I have is that I need access to ScheduleCallback. I can write common routines in another class and use them that way but I would not have access to the Game functions, including things like BigDB.
Here is what PlayerIO says:
- Code: Select all
Trying last loaded dll
- error: The Game class 'AzuanaGames.Room`1' does not have a [RoomType(...)] attribute, and is not an abstract base class.
Is there another solution I'm not considering?