|
| static void | SetAdmin (string passKey) |
| | Set administrator privileges. Note that failing the password test will cause a disconnect. More...
|
| |
| static void | AddAdmin (string passKey) |
| | Add a new pass key to the admin file. More...
|
| |
| static void | RemoveAdmin (string passKey) |
| | Remove the specified pass key from the admin file. More...
|
| |
| static void | SetAlias (string alias) |
| | Set a player alias. Player aliases can be used to store useful player-associated data such as Steam usernames, database IDs, or other unique identifiers. Aliases will show up in TNet's log and can also be banned by on the server side. When a player is banned, all their aliases are banned as well, so be careful to make sure that they are indeed unique. All aliases are visible via TNet.Player.aliases list of each player. More...
|
| |
| static void | ResetPacketCount () |
| | Immediately reset the packet count. Calling this isn't necessary as they get updated once per second anyway. More...
|
| |
| static bool | IsHosting (int channelID) |
| | Whether the player is hosting this channel. More...
|
| |
| static bool | IsChannelLocked (int channelID) |
| | Whether the specified channel is currently locked. More...
|
| |
| static bool | IsInChannel (int channelID) |
| | Check to see if we are currently in the specified channel. More...
|
| |
| static Player | GetHost (int channelID) |
| | Get the player hosting the specified channel. Only works for the channels the player is in. More...
|
| |
| static List< Player > | GetPlayers (int channelID) |
| | Get a list of players under the specified channel. This will only work for channels the player has joined. The returned list will not include TNManager.player. More...
|
| |
| static DataNode | GetServerData (string key) |
| | Retrieve the specified server option. More...
|
| |
| static T | GetServerData< T > (string key) |
| | Retrieve the specified server option. More...
|
| |
| static T | GetServerData< T > (string key, T def) |
| | Retrieve the specified server option. More...
|
| |
| static void | SetServerData (string text) |
| | Set the specified server option using key = value notation. More...
|
| |
| static void | SetServerData (DataNode node) |
| | Set the specified server option. More...
|
| |
| static void | SetServerData (string key, object val) |
| | Set the specified server option. More...
|
| |
| static Channel | GetChannel (int channelID) |
| | Return a channel with the specified ID. This will only work as long as the player is in this channel. More...
|
| |
| static DataNode | GetChannelData (string key) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static T | GetChannelData< T > (string key) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static T | GetChannelData< T > (string key, T def) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static DataNode | GetChannelData (int channelID, string key) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static T | GetChannelData< T > (int channelID, string key) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static T | GetChannelData< T > (int channelID, string key, T def) |
| | Convenience method: Retrieve the specified channel option. More...
|
| |
| static void | SetChannelData (string key, object val) |
| | Set the specified channel option. More...
|
| |
| static void | SetChannelData (int channelID, string key, object val) |
| | Set the specified channel option. More...
|
| |
| static Player | GetPlayer (int id) |
| | Get the player associated with the specified ID. More...
|
| |
| static Player | GetPlayer (string name) |
| | Get the player associated with the specified name. More...
|
| |
| static Player | FindPlayer (string name) |
| | Find the player associated with the specified partial name. This function is not case sensitive, so calling it with "Ren" will return "Aren Mook" as a possible choice. More...
|
| |
| static DataNode | GetPlayerData (string path) |
| | Get our player's data. More...
|
| |
| static T | GetPlayerData< T > (string path) |
| | Convenience method: Get the specified value from our player. More...
|
| |
| static T | GetPlayerData< T > (string path, T defaultVal) |
| | Convenience method: Get the specified value from our player. More...
|
| |
| static void | SetPlayerData (string path, object val) |
| | Set the specified value on our player. More...
|
| |
| static void | SetPlayerData (string text) |
| | Set the specified value on our player using key = value notation. More...
|
| |
| static void | GetChannelList (GameClient.OnGetChannels callback) |
| | Get a list of channels from the server. More...
|
| |
| static void | SetPacketHandler (byte packetID, GameClient.OnPacket callback) |
| | Set the following function to handle this type of packets. More...
|
| |
| static void | SetPacketHandler (Packet packet, GameClient.OnPacket callback) |
| | Set the following function to handle this type of packets. More...
|
| |
| static bool | StartUDP (int udpPort) |
| | Start listening for incoming UDP packets on the specified port. More...
|
| |
| static void | StopUDP () |
| | Stop listening to incoming UDP packets. More...
|
| |
| static void | Ping (IPEndPoint udpEndPoint, TNEvents.OnPing callback) |
| | Send a remote ping request to the specified TNet server. More...
|
| |
| static void | Connect () |
| | Connect to a local server. More...
|
| |
| static void | Connect (string address) |
| | Connect to the specified destination with the address and port specified as "255.255.255.255:255". More...
|
| |
| static void | Connect (string address, int port) |
| | Connect to the specified destination. More...
|
| |
| static void | Connect (IPEndPoint externalIP, IPEndPoint internalIP) |
| | Connect to the specified remote destination. More...
|
| |
| static void | Disconnect () |
| | Disconnect from the specified destination. More...
|
| |
| static void | JoinChannel (int channelID, bool persistent=false, bool leaveCurrentChannel=false) |
| | Join the specified channel. More...
|
| |
| static void | JoinChannel (int channelID, string levelName, bool leaveCurrentChannel=true) |
| | Join the specified channel. This channel will be marked as persistent, meaning it will stay open even when the last player leaves, unless explicitly closed first. More...
|
| |
| static void | JoinChannel (int channelID, string levelName, bool persistent, int playerLimit, string password, bool leaveCurrentChannel=true) |
| | Join the specified channel. More...
|
| |
| static void | JoinRandomChannel (string levelName, bool persistent, int playerLimit, string password, bool leaveCurrentChannel=true) |
| | Join a random open game channel or create a new one. Guaranteed to load the specified level. More...
|
| |
| static void | CreateChannel (string levelName, bool persistent, int playerLimit, string password, bool leaveCurrentChannel=true) |
| | Create a new channel. More...
|
| |
| static void | CloseChannel () |
| | Close the channel the player is in. New players will be prevented from joining. Once a channel has been closed, it cannot be re-opened. More...
|
| |
| static void | CloseChannel (int channelID) |
| | Close the channel the player is in. New players will be prevented from joining. Once a channel has been closed, it cannot be re-opened. More...
|
| |
| static void | LeaveAllChannels () |
| | Leave all of the channels we're currently in. More...
|
| |
| static void | LeaveChannel () |
| | Leave the channel we're in. More...
|
| |
| static void | LeaveChannel (int channelID) |
| | Leave the channel we're in. More...
|
| |
| static void | DeleteChannel (int id, bool disconnect) |
| | Delete the specified channel. More...
|
| |
| static void | SetPlayerLimit (int max) |
| | Change the maximum number of players that can join the channel the player is currently in. More...
|
| |
| static void | SetPlayerLimit (int channelID, int max) |
| | Change the maximum number of players that can join the channel the player is currently in. More...
|
| |
| static void | LoadLevel (string levelName) |
| | Load the specified level. More...
|
| |
| static void | LoadLevel (int channelID, string levelName) |
| | Load the specified level. More...
|
| |
| static void | SaveFile (string filename, byte[] data) |
| | Save the specified file on the server. More...
|
| |
| static void | LoadFile (string filename, GameClient.OnLoadFile callback) |
| | Load the specified file residing on the server. More...
|
| |
| static void | SetPlayerSave (string filename, DataNode.SaveType type=DataNode.SaveType.Binary) |
| | Specify where the player's data should be saved. You only need to call this function once and TNet will automatically save the player file for you every time you use TNManager.SetPlayerData afterwards. More...
|
| |
| static void | DeleteFile (string filename) |
| | Delete the specified file on the server. More...
|
| |
| static void | SetHost (Player player) |
| | Change the hosting player. More...
|
| |
| static void | SetHost (int channelID, Player player) |
| | Change the hosting player. More...
|
| |
| static void | SetTimeout (int seconds) |
| | Set the timeout for the player. By default it's 10 seconds. If you know you are about to load a large level, and it's going to take, say 60 seconds, set this timeout to 120 seconds just to be safe. When the level finishes loading, change this back to 10 seconds so that dropped connections gets detected correctly. More...
|
| |
| static void | LockChannel (bool locked) |
| | Lock the channel the player is currently in. More...
|
| |
| static void | LockChannel (int channelID, bool locked) |
| | Lock the specified channel, preventing all future persistent RFCs from being saved. More...
|
| |
| static void | Instantiate (int rccID, string path, bool persistent, params object[] objs) |
| | Create a packet that will send a custom object creation call. Instantiate a new game object in the current channel on all connected players. More...
|
| |
| static void | Instantiate (string funcName, string path, bool persistent, params object[] objs) |
| | Create a packet that will send a custom object creation call. Instantiate a new game object in the current channel on all connected players. More...
|
| |
| static void | Instantiate (int channelID, int rccID, string path, bool persistent, params object[] objs) |
| | Create a packet that will send a custom object creation call. Instantiate a new game object in the specified channel on all connected players. More...
|
| |
| static void | Instantiate (int channelID, string funcName, string path, bool persistent, params object[] objs) |
| | Create a packet that will send a custom object creation call. Instantiate a new game object in the specified channel on all connected players. More...
|
| |
| static void | AddRCCs< T > () |
| | Add a new Remote Creation Call. More...
|
| |
| static void | AddRCCs (System.Type type) |
| | Add a new Remote Creation Call. More...
|
| |
| static void | Log (string text) |
| | Write a server log entry. More...
|
| |
| static BinaryWriter | BeginSend (Packet type) |
| | Begin sending a new packet to the server. More...
|
| |
| static BinaryWriter | BeginSend (byte packetID) |
| | Begin sending a new packet to the server. More...
|
| |
| static void | EndSend () |
| | Send the outgoing buffer. This should only be used for generic packets going straight to the server. Packets that are going to a channel should use EndSend(channelID, reliable) function instead. More...
|
| |
| static void | EndSend (int channelID, bool reliable=true) |
| | Send the outgoing buffer. More...
|
| |
| static void | EndSendToLAN (int port) |
| | Broadcast the packet to everyone on the LAN. More...
|
| |
| static void | EndSend (IPEndPoint target) |
| | Broadcast the packet to the specified endpoint via UDP. More...
|
| |
| static bool | WriteCache (string path, byte[] data, bool inMyDocuments=false) |
| | Write the specified data into a local cache file belonging to connected server. More...
|
| |
| static byte[] | ReadCache (string path) |
| | Read the specified file from the cache belonging to the connected server. More...
|
| |
| static int | IndexOf (GameObject go) |
| | Find the index of the specified game object. More...
|
| |
| static void | AddToReceiveQueue (TNet.Buffer buff) |
| | Add the specified packet to the receive queue. Useful for inserting messages to be processed by the network manager. More...
|
| |
| static void | SetServerOption (string text) |
| |
| static void | SetServerOption (string key, object val) |
| |
| static void | SetServerOption (DataNode node) |
| |
| static void | SetChannelOption (DataNode node) |
| |
| static void | EndSend (bool reliable) |
| |
| static DataNode | GetServerOption (string key) |
| |
| static T | GetServerOption< T > (string key) |
| |
| static T | GetServerOption< T > (string key, T def) |
| |
| static void | Destroy (GameObject go) |
| |
|
| static TNEvents.OnPing | onPing [get, set] |
| | Ping notification. More...
|
| |
| static TNEvents.OnError | onError [get, set] |
| | Error notification. More...
|
| |
| static TNEvents.OnConnect | onConnect [get, set] |
| | Connection attempt result indicating success or failure. More...
|
| |
| static TNEvents.OnDisconnect | onDisconnect [get, set] |
| | Notification sent after the connection terminates for any reason. More...
|
| |
| static TNEvents.OnJoinChannel | onJoinChannel [get, set] |
| | Notification sent when attempting to join a channel, indicating a success or failure. More...
|
| |
| static TNEvents.OnLeaveChannel | onLeaveChannel [get, set] |
| | Notification sent when leaving a channel for any reason, including being disconnected. More...
|
| |
| static TNEvents.OnLoadLevel | onLoadLevel [get, set] |
| | Notification sent when changing levels. More...
|
| |
| static TNEvents.OnPlayerJoin | onPlayerJoin [get, set] |
| | Notification sent when a new player joins the channel. More...
|
| |
| static TNEvents.OnPlayerLeave | onPlayerLeave [get, set] |
| | Notification sent when a player leaves the channel. More...
|
| |
| static TNEvents.OnRenamePlayer | onRenamePlayer [get, set] |
| | Notification of some player changing their name. More...
|
| |
| static TNEvents.OnHostChanged | onHostChanged [get, set] |
| | Notification sent when the channel's host changes. More...
|
| |
| static TNEvents.OnSetServerData | onSetServerData [get, set] |
| | Notification sent when the server's data gets changed. More...
|
| |
| static TNEvents.OnSetChannelData | onSetChannelData [get, set] |
| | Notification sent when the channel's data gets changed. More...
|
| |
| static TNEvents.OnSetPlayerData | onSetPlayerData [get, set] |
| | Notification sent when player data gets changed. More...
|
| |
| static TNEvents.OnLockChannel | onLockChannel [get, set] |
| | Callback triggered when the channel becomes locked or unlocked. More...
|
| |
| static TNEvents.OnSetAdmin | onSetAdmin [get, set] |
| | Callback triggered when the player gets verified as an administrator. More...
|
| |
| static bool | isAdmin [get] |
| | Whether the player has verified himself as an administrator. More...
|
| |
| static GameClient | client [get] |
| | TNet Client used for communication. More...
|
| |
| static bool | isConnected [get] |
| | Whether we're currently connected. More...
|
| |
| static int | sentPackets [get] |
| | How many packets were sent in the last second. More...
|
| |
| static int | receivedPackets [get] |
| | How many packets have been received in the last second. More...
|
| |
| static bool | isJoiningChannel [get] |
| | Whether we are currently in the process of joining a channel. To find out whether we are joining a specific channel, use the "IsJoiningChannel(id)" function. More...
|
| |
| static bool | isTryingToConnect [get] |
| | Whether we are currently trying to establish a new connection. More...
|
| |
| static bool | isHosting [get] |
| | Whether we're currently hosting. Note that this should only be used if the player is in only one channel. More...
|
| |
| static bool | isInChannel [get] |
| | Whether we're currently in any channel. To find out if we are in a specific channel, use TNManager.IsInChannel(id). More...
|
| |
| static bool | isActive [get, set] |
| | You can pause TNManager's message processing if you like. This happens automatically when a scene is being loaded. More...
|
| |
| static bool | noDelay [get, set] |
| | Enable or disable the Nagle's buffering algorithm (aka NO_DELAY flag). Enabling this flag will improve latency at the cost of increased bandwidth. http://en.wikipedia.org/wiki/Nagle's_algorithm More...
|
| |
| static int | ping [get] |
| | Current ping to the server. More...
|
| |
| static bool | canUseUDP [get] |
| | Whether we can use unreliable packets (UDP) to communicate with the server. More...
|
| |
| static int | listeningPort [get] |
| | Listening port for incoming UDP packets. Set via TNManager.StartUDP(). More...
|
| |
| static long | serverTime [get] |
| | Current time on the server in milliseconds. More...
|
| |
| static long | serverUptime [get] |
| | Server's uptime in milliseconds. More...
|
| |
| static double | time [get] |
| | Time elapsed either since the server has been started up in seconds, or (if not connected) – time since TNManager was first used. It's a more precise version of Unity's Time.time, since it takes a mere 3 hours for float precision to start dropping milliseconds. More...
|
| |
| static long | playedTime [get] |
| | Player's /played time in seconds. This value is automatically tracked by the server and is saved as a part of the player file. More...
|
| |
| static int | packetSourceID [get] |
| | Forward and Create type packets write down their source. If the packet was sent by the server instead of another player, the ID will be 0. More...
|
| |
| static IPEndPoint | packetSourceIP [get] |
| | Address from which the packet was received. Only available during packet processing callbacks. If null, then the packet arrived via the active connection (TCP). If the return value is not null, then the last packet arrived via UDP. More...
|
| |
| static IPEndPoint | tcpEndPoint [get] |
| | TCP end point, available only if we're actually connected to the server. More...
|
| |
| static List< Channel > | channels [get] |
| | List of channels the player is currently in. More...
|
| |
| static int | playerID [get] |
| | The player's unique identifier. More...
|
| |
| static string | playerName [get, set] |
| | Get or set the player's name as everyone sees him on the network. More...
|
| |
| static DataNode | playerData [get, set] |
| | Get or set the player's data, synchronizing it with the server. To change the data, use TNManager.SetPlayerData instead of changing the content directly. More...
|
| |
| static List< Player > | players [get] |
| | List of other players in the same channel as the client. This list does not include TNManager.player. More...
|
| |
| static Player | player [get] |
| | Get the local player. More...
|
| |
| static DataNode | serverData [get, set] |
| | Server configuration is set by administrators. In most cases you should use GetServerData and SetServerData functions instead. More...
|
| |
| static DataNode | playerDataNode [get] |
| |
| static DataNode | serverOptions [get] |
| |
| static IPEndPoint | packetSource [get] |
| |
| static bool | isChannelLocked [get] |
| |
| static string | channelData [get, set] |
| |
| static int | channelID [get] |
| |
| static int | hostID [get] |
| |