示例#1
0
    void HandlePlayerCommands(ConnectionObject co, NetworkingMessage inmsg)
    {
        CmdState cmd = NetworkingMessageTranslator.ParseShipCommands(inmsg.content);

        if (state == ServerState.COMMAND)
        {
            bool valid = gr.AddPlayersCommands(cmd, co.serverPlayerID);

            if (!valid)
            {
                //TODO
                // Send msg back to client saying cmd are invalid
            }

            // CHECK IF ALL PLAYER CMDS ARE IN
            // IF SO BEGIN PROCESSING
            if (ReadyToProcess())
            {
                state = ServerState.PROCESSING;
                Debug.Log("Beginning to process gamestate");
            }
        }
    }