Project

General

Profile

OpenSpace3D libs
OpenSpace 3D libraries for plugITs and OS3D developer
Loading...
Searching...
No Matches
OpenSpace3D Network API

Functions

 netUserGetItemValue (netstr, userstr, item)
 Get a user item value.
 
 netUserSetItemValue (netstr, userstr, item, val)
 Set a user item value.
 
 netRoomGetItemValue (netstr, item)
 Get a room item value.
 
 netRoomSetItemValue (netstr, item, val)
 Set a room item value.
 
 netUserGetLogin (userstr)
 Get a user login.
 
 netUserGetId (userstr)
 Get a user id.
 
 netGetUserByLogin (netstr, login)
 Get a user by it's login.
 
 netGetUserById (netstr, id)
 Get a user by it's id.
 
 netThisId (netstr)
 Get the current client user id.
 
 netThisUser (netstr)
 Get the current client user.
 
 netThisLogin (netstr)
 Get the current client login.
 
 netGetNbUsers (netstr)
 Get the number of actual users.
 
 netSendFile (netstr, userstr, flag, cmd, filename)
 Send a file.
 
 netGetFile (netstr, userstr, flag, cmd, filename)
 Request a file.
 
 netSendMessageExt (netstr, cmd, message, arg)
 Send a message to the server with arguments.
 
 netSendMessage (netstr, cmd, message)
 Send a message to the server.
 
 netSendBroadMessageSecure (netstr, cmd, message, reply)
 Broad a secure message to all users connected in the same room.
 
 netSendBroadMessage (netstr, cmd, message, reply)
 Broad a message to all users connected in the same room.
 
 netUpdateUserItem (netstr, item, val)
 Set a client item value.
 
 netUpdateRoomItem (netstr, item, val)
 Set a room item value.
 
 netSendRsaMessage (netstr, cmd, message)
 Send a RSA encrypted message to the server.
 
 netSendPrivateMessageSecure (netstr, userstr, cmd, message)
 Send a secure private message to another user.
 
 netSendPrivateMessage (netstr, userstr, cmd, message)
 Send a private message to another user.
 
 netKickUser (netstr, userstr)
 Send a request to kick a user from the server.
The user will be kicked only if several other users send this request.
 
 netFormatMessage (netstr, userstr, message)
 Format a message and replace itemname% by the user item values.
 
 netIsConnected (netstr)
 Get the connection state.
 
 netDisconnect (netstr)
 Disconnect from the server.
 
 netCreateExt (server, port, script, env)
 Create a network structure to prepare the connection to a server with advanced parameters.
 
 netCreate (server, port)
 Create a network structure to prepare the connection to a server.
 
 netCreateMinimum ()
 Create an empty NetComm structure.
 
 netConnect (netstr)
 Connect to a server.
 
 netReconnect (netstr)
 Force a server re connection.
 
 netSetServer (netstr, server, port)
 Set a server url and port.
 
 netChangeLogin (netstr, login)
 Change the current user login.
 
 netChangeRoom (netstr, room)
 Change the current room.
 

Detailed Description

OpenSpace3D Network API

Function Documentation

◆ netUserGetItemValue()

netUserGetItemValue ( netstr  ,
userstr  ,
item   
)

Get a user item value.

Prototype: fun [NetComm NetUser S] S

Parameters
NetComm: the network structure
NetUser: the user structure
S: the item name
Returns
S : the item value, or nil if not found

◆ netUserSetItemValue()

netUserSetItemValue ( netstr  ,
userstr  ,
item  ,
val   
)

Set a user item value.

Prototype: fun [NetComm NetUser S S] I

Parameters
NetComm: the network structure
NetUser: the user structure
S: the item name
S: the new item value
Returns
0

◆ netRoomGetItemValue()

netRoomGetItemValue ( netstr  ,
item   
)

Get a room item value.

Prototype: fun [NetComm S] S

Parameters
NetComm: the network structure
S: the item name
Returns
S : the item value, or nil if not found

◆ netRoomSetItemValue()

netRoomSetItemValue ( netstr  ,
item  ,
val   
)

Set a room item value.

Prototype: fun [NetComm S S] I

Parameters
NetComm: the network structure
S: the item name
S: the new item value
Returns
0

◆ netUserGetLogin()

netUserGetLogin ( userstr  )

Get a user login.

Prototype: fun [NetUser] S

Parameters
NetUser: the user structure
Returns
S : the user login

◆ netUserGetId()

netUserGetId ( userstr  )

Get a user id.

Prototype: fun [NetUser] I

Parameters
NetUser: the user structure
Returns
I : the user id

◆ netGetUserByLogin()

netGetUserByLogin ( netstr  ,
login   
)

Get a user by it's login.

Prototype: fun [NetComm S] NetUser

Parameters
NetComm: the network structure
S: the user login
Returns
NetUser : the user structure or nil if not found

◆ netGetUserById()

netGetUserById ( netstr  ,
id   
)

Get a user by it's id.

Prototype: fun [NetComm I] NetUser

Parameters
NetComm: the network structure
I: the user id
Returns
NetUser : the user structure or nil if not found

◆ netThisId()

netThisId ( netstr  )

Get the current client user id.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
I : the client user id

◆ netThisUser()

netThisUser ( netstr  )

Get the current client user.

Prototype: fun [NetComm] NetUser

Parameters
NetComm: the network structure
Returns
NetUser : the user structure

◆ netThisLogin()

netThisLogin ( netstr  )

Get the current client login.

Prototype: fun [NetComm] S

Parameters
NetComm: the network structure
Returns
S : the current user login

◆ netGetNbUsers()

netGetNbUsers ( netstr  )

Get the number of actual users.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
I : the number of actual users

◆ netSendFile()

netSendFile ( netstr  ,
userstr  ,
flag  ,
cmd  ,
filename   
)

Send a file.

Prototype: fun [NetComm NetUser I S S] I

Parameters
NetComm: the network structure
NetUser: the user structure, this can be nil to send it to all users
I: message flags, nil for default
S: command
S: the file name to request
Returns
0

◆ netGetFile()

netGetFile ( netstr  ,
userstr  ,
flag  ,
cmd  ,
filename   
)

Request a file.

Prototype: fun [NetComm NetUser I S S] I

Parameters
NetComm: the network structure
NetUser: the user structure, this can be nil to request it from all users
I: message flags, nil for default
S: command
S: the file name to request
Returns
0

◆ netSendMessageExt()

netSendMessageExt ( netstr  ,
cmd  ,
message  ,
arg   
)

Send a message to the server with arguments.

Prototype: fun [NetComm S S S] I

Parameters
NetComm: the network structure
S: command
S: message
S: arguments
Returns
0

◆ netSendMessage()

netSendMessage ( netstr  ,
cmd  ,
message   
)

Send a message to the server.

Prototype: fun [NetComm S S] I

Parameters
NetComm: the network structure
S: command
S: message
Returns
0

◆ netSendBroadMessageSecure()

netSendBroadMessageSecure ( netstr  ,
cmd  ,
message  ,
reply   
)

Broad a secure message to all users connected in the same room.

Prototype: fun [NetComm S S S] I

Parameters
NetComm: the network structure
S: command
S: message
S: reply
Returns
0

◆ netSendBroadMessage()

netSendBroadMessage ( netstr  ,
cmd  ,
message  ,
reply   
)

Broad a message to all users connected in the same room.

Prototype: fun [NetComm S S I] I

Parameters
NetComm: the network structure
S: command
S: message
I: 1 if the client must receive his hown sent message, 0 otherwise
Returns
0

◆ netUpdateUserItem()

netUpdateUserItem ( netstr  ,
item  ,
val   
)

Set a client item value.

Prototype: fun [NetComm S S] I

Parameters
NetComm: the network structure
S: the item name
S: the new item value
Returns
0

◆ netUpdateRoomItem()

netUpdateRoomItem ( netstr  ,
item  ,
val   
)

Set a room item value.

Prototype: fun [NetComm S S] I

Parameters
NetComm: the network structure
S: the item name
S: the new item value
Returns
0

◆ netSendRsaMessage()

netSendRsaMessage ( netstr  ,
cmd  ,
message   
)

Send a RSA encrypted message to the server.

Prototype: fun [NetComm S S] I

Parameters
NetComm: the network structure
S: command
S: message
Returns
0

◆ netSendPrivateMessageSecure()

netSendPrivateMessageSecure ( netstr  ,
userstr  ,
cmd  ,
message   
)

Send a secure private message to another user.

Prototype: fun [NetComm NetUser S S] I

Parameters
NetComm: the network structure
NetUser: the destination user structure
S: command
S: message
Returns
0

◆ netSendPrivateMessage()

netSendPrivateMessage ( netstr  ,
userstr  ,
cmd  ,
message   
)

Send a private message to another user.

Prototype: fun [NetComm NetUser S S] I

Parameters
NetComm: the network structure
NetUser: the destination user structure
S: command
S: message
Returns
0

◆ netKickUser()

netKickUser ( netstr  ,
userstr   
)

Send a request to kick a user from the server.
The user will be kicked only if several other users send this request.

Prototype: fun [NetComm NetUser] I

Parameters
NetComm: the network structure
NetUser: the user structure to kick
Returns
0

◆ netFormatMessage()

netFormatMessage ( netstr  ,
userstr  ,
message   
)

Format a message and replace itemname% by the user item values.

Prototype: fun [NetComm NetUser S] S

Parameters
NetComm: the network structure
NetUser: the user structure
S: the message to format
Returns
S : the formated message

◆ netIsConnected()

netIsConnected ( netstr  )

Get the connection state.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
I : 1 if the connection is available, 0 if not

◆ netDisconnect()

netDisconnect ( netstr  )

Disconnect from the server.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
0

◆ netCreateExt()

netCreateExt ( server  ,
port  ,
script  ,
env   
)

Create a network structure to prepare the connection to a server with advanced parameters.

Prototype: fun [S I S Env] NetComm

Parameters
S: the server name or ip address
I: the server port
S: the connection script
Env: the scol environment
Returns
NetComm : the new network structure

◆ netCreate()

netCreate ( server  ,
port   
)

Create a network structure to prepare the connection to a server.

Prototype: fun [S I] NetComm

Parameters
S: the server name or ip address
I: the server port
Returns
NetComm : the new network structure

◆ netCreateMinimum()

netCreateMinimum ( )

Create an empty NetComm structure.

Prototype: fun [] NetComm

Returns
NetComm : the new network structure

◆ netConnect()

netConnect ( netstr  )

Connect to a server.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
I : 1 if successful connected, 0 otherwise

◆ netReconnect()

netReconnect ( netstr  )

Force a server re connection.

Prototype: fun [NetComm] I

Parameters
NetComm: the network structure
Returns
I : 1 if successful connected, 0 otherwise

◆ netSetServer()

netSetServer ( netstr  ,
server  ,
port   
)

Set a server url and port.

Prototype: fun [NetComm S I] NetComm

Parameters
NetComm: the network structure
S: the server name or ip address
I: the server port
Returns
NetComm : the same network structure

◆ netChangeLogin()

netChangeLogin ( netstr  ,
login   
)

Change the current user login.

Prototype: fun [NetComm S] I

Parameters
NetComm: the network structure
S: the new requested login
Returns
0

◆ netChangeRoom()

netChangeRoom ( netstr  ,
room   
)

Change the current room.

Prototype: fun [NetComm S] I

Parameters
NetComm: the network structure
S: the new requested room
Returns
0