Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 1006 Bytes

README.md

File metadata and controls

35 lines (30 loc) · 1006 Bytes

nakamapy

A partly implemented OOP Python-Wrapper for Nakama Server

Examples

Client

The Client will be used to connect to the Server

client = Nakama(server_key='defaultkey', server_ip='127.0.0.1', server_port=7350)

Session

Sessions are used to Interact with the Server

session = asyncio.get_event_loop().run_until_complete(client.authenticate_device('exampleDeviceUser'))
print(session.token)
print(session.user_id)
print(session.username)
print(session.expire_date)
print(session.is_expired)

Socket

With the Socket connection you exchange realtime data with the Server

socket = client.create_socket()
asyncio.get_event_loop().run_until_complete(socket.connect())

Account

Use the Account Object to get all informations about the current User.

account = asyncio.get_event_loop().run_until_complete(client.fetch_account(session_token=session.token))
print(account.wallet, account.user)