siege.network

Message

class Message
ACHIEVEMENT_SYSTEM = siege.network.Message.ACHIEVEMENT_SYSTEM
AUDIO_MUSIC = siege.network.Message.AUDIO_MUSIC
AUDIO_SYSTEM = siege.network.Message.AUDIO_SYSTEM
CARTOGRAPHY = siege.network.Message.CARTOGRAPHY
CHANGE_INPUT_STATE = siege.network.Message.CHANGE_INPUT_STATE
CHANGE_TOOL_STATE = siege.network.Message.CHANGE_TOOL_STATE
CHARACTER_CREATE = siege.network.Message.CHARACTER_CREATE
CHARACTER_DESTROY = siege.network.Message.CHARACTER_DESTROY
CHARACTER_GRABBED = siege.network.Message.CHARACTER_GRABBED
CHARACTER_INFO = siege.network.Message.CHARACTER_INFO
CHARACTER_INFO_LIST = siege.network.Message.CHARACTER_INFO_LIST
CHARACTER_INFUSION = siege.network.Message.CHARACTER_INFUSION
CHARACTER_MOVE = siege.network.Message.CHARACTER_MOVE
CHARACTER_SAVE = siege.network.Message.CHARACTER_SAVE
CHAT_PLAYER = siege.network.Message.CHAT_PLAYER
CHAT_SYSTEM = siege.network.Message.CHAT_SYSTEM
COMBAT_ATTACK = siege.network.Message.COMBAT_ATTACK
CONFLICT = siege.network.Message.CONFLICT
CONNECTION_LOST = siege.network.Message.CONNECTION_LOST
CONNECTION_REQUEST_ACCEPTED = siege.network.Message.CONNECTION_REQUEST...
DISCONNECTION_NOTIFICATION = siege.network.Message.DISCONNECTION_NOTIF...
DUNGEONEER = siege.network.Message.DUNGEONEER
DUNGEON_INFO = siege.network.Message.DUNGEON_INFO
ENTITY_RENAME = siege.network.Message.ENTITY_RENAME
GADGET_USE = siege.network.Message.GADGET_USE
HIDE_UI = siege.network.Message.HIDE_UI
INVALID_PASSWORD = siege.network.Message.INVALID_PASSWORD
INVENTORY_CLOSE = siege.network.Message.INVENTORY_CLOSE
INVENTORY_INTERACT = siege.network.Message.INVENTORY_INTERACT
ITEM_CLAIM = siege.network.Message.ITEM_CLAIM
ITEM_CRAFT = siege.network.Message.ITEM_CRAFT
ITEM_DROP = siege.network.Message.ITEM_DROP
ITEM_INTERACT = siege.network.Message.ITEM_INTERACT
ITEM_INVENTORY_EQUIP = siege.network.Message.ITEM_INVENTORY_EQUIP
ITEM_QUICK_SELECT = siege.network.Message.ITEM_QUICK_SELECT
ITEM_RESEARCH = siege.network.Message.ITEM_RESEARCH
ITEM_RETURN_GRAB = siege.network.Message.ITEM_RETURN_GRAB
ITEM_SET_TOOLBAR = siege.network.Message.ITEM_SET_TOOLBAR
ITEM_SPLIT = siege.network.Message.ITEM_SPLIT
ITEM_SWAP_ARMS = siege.network.Message.ITEM_SWAP_ARMS
ITEM_SWAP_WITH_GRAB = siege.network.Message.ITEM_SWAP_WITH_GRAB
ITEM_TRASH = siege.network.Message.ITEM_TRASH
ITEM_UNEQUIP = siege.network.Message.ITEM_UNEQUIP
ITEM_USE = siege.network.Message.ITEM_USE
MERCHANT_CHANGE = siege.network.Message.MERCHANT_CHANGE
NOTIFICATION_SYSTEM = siege.network.Message.NOTIFICATION_SYSTEM
NPC_DISMISS = siege.network.Message.NPC_DISMISS
NPC_INTERACT = siege.network.Message.NPC_INTERACT
PARTICLE_SYSTEM = siege.network.Message.PARTICLE_SYSTEM
PLAYER_ANIMATION = siege.network.Message.PLAYER_ANIMATION
PLAYER_CHANGE_MODE = siege.network.Message.PLAYER_CHANGE_MODE
PLAYER_FORCE = siege.network.Message.PLAYER_FORCE
PLAYER_INPUT = siege.network.Message.PLAYER_INPUT
PLAYER_POSITION = siege.network.Message.PLAYER_POSITION
PLAYER_READY = siege.network.Message.PLAYER_READY
PLAYER_RESERVE = siege.network.Message.PLAYER_RESERVE
PLAYER_RESPAWN = siege.network.Message.PLAYER_RESPAWN
PYTHON_MESSAGE = siege.network.Message.PYTHON_MESSAGE
QUICK_USE = siege.network.Message.QUICK_USE
RESEARCH_DATA = siege.network.Message.RESEARCH_DATA
RESEARCH_INTERACT = siege.network.Message.RESEARCH_INTERACT
RESOLUTION_CHANGED = siege.network.Message.RESOLUTION_CHANGED
SCAVENGER_CHANGE = siege.network.Message.SCAVENGER_CHANGE
SELL_ITEMS = siege.network.Message.SELL_ITEMS
SHOW_COMBAT_NUMBER = siege.network.Message.SHOW_COMBAT_NUMBER
SHOW_UI = siege.network.Message.SHOW_UI
SKILL_USE = siege.network.Message.SKILL_USE
TALENT_PURCHASE_SKILL = siege.network.Message.TALENT_PURCHASE_SKILL
TILE_INFO = siege.network.Message.TILE_INFO
TRAVEL = siege.network.Message.TRAVEL
TRAVEL_ATTUNE = siege.network.Message.TRAVEL_ATTUNE
TRAVEL_SELECT = siege.network.Message.TRAVEL_SELECT
TRAVEL_SHOW_UI = siege.network.Message.TRAVEL_SHOW_UI
VERSION_CHECK = siege.network.Message.VERSION_CHECK
WORLD_INFO = siege.network.Message.WORLD_INFO

PacketPriority

class PacketPriority
High = siege.network.PacketPriority.High
Immediate = siege.network.PacketPriority.Immediate
Low = siege.network.PacketPriority.Low
Medium = siege.network.PacketPriority.Medium

PacketReliability

class PacketReliability
Reliable = siege.network.PacketReliability.Reliable
ReliableOrdered = siege.network.PacketReliability.ReliableOrdered
ReliableOrderedReceipt = siege.network.PacketReliability.ReliableOrder...
ReliableReceipt = siege.network.PacketReliability.ReliableReceipt
ReliableSequenced = siege.network.PacketReliability.ReliableSequenced
Unreliable = siege.network.PacketReliability.Unreliable
UnreliableReceipt = siege.network.PacketReliability.UnreliableReceipt
UnreliableSequenced = siege.network.PacketReliability.UnreliableSequen...

MessageHandler

class MessageHandler
__call__(arg2, arg3)
Parameters:
static create([func=None])
Parameters:func (object) –
Return type:MessageHandler

NetworkConnection

class NetworkConnection
__setattr__(arg2, arg3)
Parameters:
  • arg2 (str) –
  • arg3 (object) –
addMessageCallback(messageId, callback)
Parameters:
  • messageId (str) –
  • callback (object) –
broadcast(packet[, channel=0[, reliability=siege.network.PacketReliability.Reliable[, priority=siege.network.PacketPriority.Medium]]])

Broadcast a message to all available recipients.

Parameters:
  • packet (DataStream) – Data to be sent,
  • channel (int) – What channel to send this packet on.
  • reliability (PacketReliability) – How reliably to send this data.
  • priority (PacketPriority) – What priority level to send with.
Returns:

0 on bad input. Otherwise a number that identifies this message.

Return type:

int

getMessageCallback(messageId)
Parameters:messageId (str) –
Return type:object
receive()

Handle all queued incoming packets.

register(messageId, callback)

Register a handler for a specific message.

Parameters:
send(recipient, packet[, channel=0[, reliability=siege.network.PacketReliability.Reliable[, priority=siege.network.PacketPriority.Medium]]])

Sends a packet to the recipient.

Parameters:
  • recipient (NetworkId) –
  • packet (DataStream) – Data to be sent,
  • channel (int) – What channel to send this packet on.
  • reliability (PacketReliability) – How reliably to send this data.
  • priority (PacketPriority) – What priority level to send with.
Returns:

0 on bad input. Otherwise a number that identifies this message.

Return type:

int

unregister(messageId)

Unregister the handler for a message, if present.

Parameters:messageId (Message) –
usingLobby()
Return type:bool

Client

class Client
joinLobby(lobbyId)
Parameters:lobbyId (long) –
Return type:bool
send(packet[, channel=0[, reliability=siege.network.PacketReliability.Reliable[, priority=siege.network.PacketPriority.Medium]]])

Sends a packet to the server.

Parameters:
  • packet (DataStream) – Data to be sent,
  • channel (int) – What channel to send this packet on.
  • reliability (PacketReliability) – How reliably to send this data.
  • priority (PacketPriority) – What priority level to send with.
Returns:

0 on bad input. Otherwise a number that identifies this message.

Return type:

int

Server

class Server
Provides methods for kicking and banning clients.

__Banlists are currently only valid for the current instance of the server__

ban(arg2)

Bans a client from the server by ip.

Parameters:arg2 (str) –
getIp(arg2)

Retrieves the IP for the client.:param target: (NetworkId)

Parameters:arg2 (NetworkId) –
Return type:str
hasPassword()

Returns if the server is password protected or not.

Return type:bool
kick(arg2)

Kicks a client from the server.

Parameters:arg2 (NetworkId) –
unban(arg2)

Unbans a client from the server.

Parameters:arg2 (str) –
maxPlayers
name
playerCount
worldName

NetworkFriend

class NetworkFriend
lobby
name
usingPassword

NetworkFriendList

class NetworkFriendList
__contains__(arg2)
Parameters:arg2 (object) –
Return type:bool
__delitem__(arg2)
Parameters:arg2 (object) –
__getitem__(arg2)
Parameters:arg2 (object) –
Return type:object
__iter__()
Return type:object
__len__()
Return type:int
__setitem__(arg2, arg3)
Parameters:
  • arg2 (object) –
  • arg3 (object) –
append(arg2)
Parameters:arg2 (object) –
extend(arg2)
Parameters:arg2 (object) –

NetworkId

class NetworkId
__eq__(arg2)
Parameters:arg2 (NetworkId) –
Return type:object
__gt__(arg2)
Parameters:arg2 (NetworkId) –
Return type:object
__init__(arg2)
Parameters:arg2 (long) –
__lt__(arg2)
Parameters:arg2 (NetworkId) –
Return type:object
__ne__(arg2)
Parameters:arg2 (NetworkId) –
Return type:object
static toUint32(arg1)
Parameters:arg1 (NetworkId) –
Return type:int

NetworkManager

class NetworkManager
__setattr__(arg2, arg3)
Parameters:
  • arg2 (str) –
  • arg3 (object) –
canUseLobby()
Return type:bool
clearConnect()
getClient()
Return type:Client
getFriendHosts()
Return type:NetworkFriendList
getId()
Return type:NetworkId
getServer()
Return type:Server
reset()
setupClient(address, port, password)
Parameters:
  • address (str) –
  • port (int) –
  • password (str) –
setupPassthrough()
setupServer(port, password[, hostAddress=''])
Parameters:
  • port (int) –
  • password (str) –
  • hostAddress (str) –
shouldConnect()
Return type:bool
update(frameTime)
Parameters:frameTime (int) –
static isHost()
Return type:bool
static isPassthrough()
Return type:bool
static isStandalone()
Return type:bool
static setStandalone(standalone)
Parameters:standalone (bool) –
connectHasPassword
connectLobby
onReset