Example #1
0
        static void Main(string[] args)
        {
            GameSocketTransport socket = new GameSocketTransport(null, 555);
            MvsAServer server = new MvsAServer(socket, socket.endPoint, 8, 1, 2);

            //server.DebugSend(socket.endPoint, Command.JOIN, PacketType.REQUEST);
            //server.DebugSend(socket.endPoint, Command.JOIN, PacketType.REQUEST);

            server.Run();
        }
Example #2
0
        public Room(int ID, MvsAServer server)
        {
            this.server = server;

            reliablePackets = new List <ReliablePacket>();

            members = new List <User>();

            Id = ID;

            t = new Stopwatch();
            UpdateInterval = 1000;

            commands = new RoomCommand[20];
            commands[(int)Command.ENTERROOM] = ManageEnterRoom;
            commands[(int)Command.READY]     = ManageReady;
            commands[(int)Command.TRANSFORM] = ManageTransform;
        }
Example #3
0
 public Room(int ID, MvsAServer server)
 {
     this.server     = server;
     reliablePackets = new List <ReliablePacket>();
     usersToRemove   = new List <User>();
     members         = new List <User>();
     machine         = new StateMachine(this);
     runState        = new RunMachineState[2];
     runState[(int)Room.RoomState.LOBBY] = Update;
     runState[(int)Room.RoomState.GAME]  = Update;
     Id             = ID;
     t              = new Stopwatch();
     UpdateInterval = 1f;
     commands       = new RoomCommand[20];
     commands[(int)Command.CHARACTERSELECTION] = ManageCharacterSelection;
     commands[(int)Command.READY]         = ManageReady;
     commands[(int)Command.TRANSFORM]     = ManageTransform;
     commands[(int)Command.PLAYERSINROOM] = ManageSendAll;
     commands[(int)Command.CHAT]          = Chat;
 }