Exemple #1
0
def login(sock, username, password):
    '登录session'
    sock.sendall(
        request_msg(
            msgid.LOGIN,
            session_pb2.LoginRequest(username=username, password=password)))
    return expect(msgid.LOGIN, session_pb2.LoginResponse)
Exemple #2
0
def login_world(sock, userID, verify_code):
    '登录世界服务器'
    sock.sendall(
        request_msg(
            msgid.LOGIN_WORLD,
            role_pb2.LoginWorldRequest(userID=userID,
                                       verify_code=verify_code)))
    return expect(msgid.LOGIN_WORLD, role_pb2.LoginWorldResponse)
Exemple #3
0
def enter(sock, entityID, newRole):
    '进入世界消息'
    sock.sendall(
        request_msg(msgid.ENTER_SCENE,
                    world_pb2.EnterRequest(entityID=entityID)))
    expect(msgid.ENTER_SCENE)
    incr_enter_count()
    if newRole:
        pass
Exemple #4
0
def login_sdk(sock, uin, sdkType):
    sock.sendall(
        request_msg(
            msgid.SDK_CHECK_LOGIN,
            sdk_pb2.SDKLoginRequest(sdkType=sdkType,
                                    sessionId='',
                                    uin=uin,
                                    deviceId='')))
    return expect(msgid.SDK_CHECK_LOGIN, session_pb2.LoginResponse)
Exemple #5
0
def start_pay(sock, sdkType=sdk_pb2.SDK_YY):
    sock.sendall(
        request_msg(msgid.SDK_PAY_START,
                    sdk_pb2.SDKStartPayRequest(sdkType=sdkType)))
    return expect(msgid.SDK_PAY_START, sdk_pb2.SDKStartPayResponse).serialNo
Exemple #6
0
def switch_scene(sock, sceneId):
    sock.sendall(
        request_msg(msgid.CHANGE_SCENE,
                    world_pb2.EnterSceneRequest(sceneId=sceneId)))
    return expect_me()
Exemple #7
0
def save_guide(sock, gid):
    sock.sendall(
        request_msg(msgid.GUIDE_SAVE, guide_pb2.SignGuide(guideId=gid)))
Exemple #8
0
def request_sync_property(sock):
    sock.sendall(request_msg(msgid.SYNC_PROPERTY))
    return expect(msgid.SYNC_PROPERTY, world_pb2.SyncProperty)
Exemple #9
0
def collide_npc(sock, entityID):
    sock.sendall(
        request_msg(msgid.COLLIDE_NPC,
                    world_pb2.NpcCollideRequest(entityID=entityID)))
Exemple #10
0
def login_key(sock, mid, code=None):
    sock.sendall(
        request_msg(
            msgid.LOGIN_KEY,
            session_pb2.LoginRequest(username=mid, password=code or '')))
    return expect(msgid.LOGIN_KEY, session_pb2.LoginResponse, allow_error=True)