this is a collection of all of the official plugins
this is the list of plugins and the developers
- console Freeboardtortoise
- usernames Freeboardtortoise
- databases Freeboardtortoise
- encrypter Freeboardtortoise
add the name of your plugin to the plugins.txt file on a new line and make sure your plugin file is in the TSC.plugins directory import your file into your program
import TSC.plugins.console as console
console.init()
console.console_thing(TSC.server.get_connections)
import TSC.plugins.encrypter as _e
passphrase = _e.generate_passphrase()
_e.generate_passphrase(passfile="filename.txt")
_e.encrypt(passphrase="passphrase",passfile="filename.txt",string="string to encrypt", shift=1)
_e.decrypt(pssphrase="passphrase",passfile="filename.txt",string="string to decrypt", shift=1)
import TSC.plugins.usernames as usernames
usernames.init("path to usernames file")
usernames.set_username(addr=addr, username="username")
username = usernames.get_username(addr=addr)
import TSC.plugins.databases as databases
conn = databases.Connection("databases.tdb")
conn.add_table(name="table name")
there are 3 datatypes for values:
- string (for strings and charactors)
- int (for whole numbers)
- float (for floats/reals) these are set in the datatype argument
conn.add_value(table="table name", key="key", value="value", datatype="string")
is is very important that you dont just do this: self.valid=True becuase the verify process makes sure that it does not run into errors later when reading
conn.verify()
this secures changes into the database NB: no changes will be reflected until you run this
conn.write()
conn.read(table="table name", key="key")
if nothing is provided for table: you will recieve all of the information in the table if nothing is provided for key and table contains a valid table: you will recieve all of the information from that table if table contains a valid table and key contains a valid key from that table: you will recieve the value
conn.edit_value(table="table name", key="key", value="new_value")
all of the arguments are required
tables = conn.get_table_list()
# TSC-encrypter must be installed
conn = databases.Connection("database.tdb", encrypt=True, passphrase="passphrase", passfile="passfile.txt") #one of the passphrase or passfile is required and not the other
this is another way of opening the connection
removing an entire table
conn.remove_table(table="table name")
removing a key from a table
conn.remove_value(table="table name", value="value")
import TSC.plugins.autoDiscovor as ad
ad.server_autodiscovor_deamon(5534, "name of the server")
arg 0 is the port to redirect the client to arg 1 is the name of the server that you must have correct on the client as well
connections = ad.connect(subnet="192.168.68.0/24", serverName="name of the server", multiple=False, limit=None, returnConnection=True):
subnet: usualy you dont need to worry about this
serverName: the name you set as the server name with the autodiscovor_deamon in the server
multiple: allow the function to connect you to multiple servers with the same name
limit: if multiple is sellected... the limit of connections it the function will give you
returnConnection: weather or not the function returns connection objects or ip addresses