예제 #1
0
파일: oche.py 프로젝트: coollen/GGSvr
def on_oche(data):
    print "on_oche", data

    conn_id = data[0]
    msg = data[1]

    gnet.send(conn_id, [PROTOCOL_OCHE_MSG, msg])  # 回发数据
예제 #2
0
def on_oche(data):
    print "on_oche", data

    conn_id = data[0]
    msg = data[1]

    gnet.send(conn_id, [PROTOCAL_OCHE_MSG, msg])  # 回发数据
예제 #3
0
def on_test_remote_call(data):
    print "on_test_remote_call", data
    
    conn_id = data[0]
    msg = data[1]

    res = gnet.call(SVR_SUB_NAME, SVR_SUB_ID, "svr_test_sub.remote_call_test", msg, dc="kwds")
    print "remote call return:",res

    gnet.send( conn_id, [prt_test_game.TEST_REMOTE_CALL, msg])
예제 #4
0
def on_test_remote_call(data):
    print "on_test_remote_call", data
    
    conn_id = data[0]
    msg = data[1]

    res = gnet.call(SVR_SUB_NAME, SVR_SUB_ID, "svr_test_sub.remote_call_test", msg, dc="kwds")
    print "remote call return:",res

    gnet.send( conn_id, [prt_test_game.TEST_REMOTE_CALL, msg])
예제 #5
0
def on_test(data):
	print "on_test", data

	conn_id = data[0]
	msg = data[1]

	time.sleep(1);
	print "sleep 1"
	time.sleep(1);
	print "sleep 1"
	time.sleep(1);
	print "sleep 1"
	gnet.send( conn_id, [msg] )
예제 #6
0
def on_test(data):
    print "on_test", data

    conn_id = data[0]
    msg = data[1]

    time.sleep(1)
    print "sleep 1"
    time.sleep(1)
    print "sleep 1"
    time.sleep(1)
    print "sleep 1"
    gnet.send(conn_id, [msg])
예제 #7
0
def on_test_sub(data):
    print "on_test_sub", data
    global player_conn_id

    conn_id = data[0]
    msg = data[1]

    #time.sleep(1)
    #print "sleep 1"
    #time.sleep(1)
    #print "sleep 1"
    #time.sleep(1)
    #print "sleep 1"
    gnet.send(player_conn_id, [prt_test_game.TEST, "main -> client"])
예제 #8
0
def on_stress_test_sub(data):
    print "on_stress_test_sub", data
    global t_sum, t_times, no_return

    conn_id = data[0]
    client_conn_id = data[1]
    t1 = data[2]

    gnet.send(client_conn_id, [prt_test_game.STRESS_TEST, "with sub server"])

    dt = time.time() - t1
    t_sum += dt
    t_times += 1
    print "cost time avg:", t_sum / t_times, "times:", t_times
예제 #9
0
def on_stress_test_sub(data):
    print "on_stress_test_sub", data
    global t_sum, t_times, no_return

    conn_id = data[0]
    client_conn_id = data[1]
    t1 = data[2]

    gnet.send( client_conn_id, [prt_test_game.STRESS_TEST, "with sub server"] )
    
    dt = time.time() - t1
    t_sum += dt
    t_times += 1
    print "cost time avg:", t_sum / t_times, "times:", t_times
예제 #10
0
def on_test_sub(data):
    print "on_test_sub", data
    global player_conn_id

    conn_id = data[0]
    msg = data[1]

    #time.sleep(1)
    #print "sleep 1"
    #time.sleep(1)
    #print "sleep 1"
    #time.sleep(1)
    #print "sleep 1"
    gnet.send( player_conn_id, [prt_test_game.TEST, "main -> client"] ) 
예제 #11
0
def on_stress_test(data):
    print "on_stress_test", data
    global t_sum, t_times, no_return

    conn_id = data[0]
    ex_data = data[1]
    """
    t_sum = 0
    t_times = 0
    
    for i in xrange(1000):
        gnet.sends(SVR_SUB_NAME, SVR_SUB_ID, [prt_test_game.STRESS_TEST_SUB, conn_id, time.time()])
        no_return += 1
    """

    #gnet.sends(SVR_SUB_NAME, SVR_SUB_ID, [prt_test_game.STRESS_TEST_SUB, conn_id, time.time()])

    gnet.send(conn_id, [prt_test_game.STRESS_TEST, ex_data])
예제 #12
0
def on_stress_test(data):
    print "on_stress_test", data
    global t_sum, t_times, no_return

    conn_id = data[0]
    ex_data = data[1]
    """
    t_sum = 0
    t_times = 0
    
    for i in xrange(1000):
        gnet.sends(SVR_SUB_NAME, SVR_SUB_ID, [prt_test_game.STRESS_TEST_SUB, conn_id, time.time()])
        no_return += 1
    """

    #gnet.sends(SVR_SUB_NAME, SVR_SUB_ID, [prt_test_game.STRESS_TEST_SUB, conn_id, time.time()])

    gnet.send( conn_id, [prt_test_game.STRESS_TEST,ex_data])