示例#1
0
import ffai.web.server as server
import ffai.web.api as api
from ffai.ai.registry import make_bot
from ffai.core.model import Agent

# Import this to register MyScriptedBot with id 'scripted'
import examples.scripted_bot_example

# Create some games
api.new_game(home_team_id="orc-1",
             away_team_id="human-1",
             home_agent=make_bot("random"),
             away_agent=Agent("Player 2", human=True))

api.new_game(home_team_id="orc-1",
             away_team_id="human-1",
             home_agent=make_bot("scripted"),
             away_agent=Agent("Player 2", human=True))

api.new_game(home_team_id="human-1",
             away_team_id="human-2",
             home_agent=Agent("Player 1", human=True),
             away_agent=Agent("Player 2", human=True))

# Run server
server.start_server(debug=True, use_reloader=True)
示例#2
0
 def start():
     server.start_server(debug=True, use_reloader=False, host="127.0.0.1", port=3405)
示例#3
0
#!/usr/bin/env python3
from grodbot import *
from scripted_bot_example import *

import ffai.web.server as server

if __name__ == "__main__":
    server.start_server(debug=True, use_reloader=False, port=1234)
示例#4
0
 def start():
     server.start_server(debug=True, use_reloader=False, port=3405)