def script_start_up(): server_type = XEngine.get_server_type() if server_type in START_UP_DISPATCH: if START_UP_DISPATCH[server_type]() != True: print("start up dispatch fail") else: on_start_up()
def on_harbor_accepted(server_type, server_id): #连接centerd成功 my_server_type = XEngine.get_server_type() if my_server_type == SERVER_TYPE_CENTERD: #接受服务器连接成功 pass
def __on_create__(entity): #start timer XEngine.add_timer(entity, "timer_cb", 10)
def __on_create__(entity): #start timer XEngine.register_global_service("service_mgr", entity)
def init_global_entity(): XEngine.create_entity_anywhere("alliance_mgr") XEngine.create_entity_anywhere("friend_mgr")
def on_gamed_start_up(): XEngine.connect_to_server(SERVER_TYPE_CENTERD, IP, PORT)
def on_centerd_start_up(): XEngine.create_entity("server_mgr")