opkshows.blogg.se

Gmod file types
Gmod file types











Furthermore, you should not save data during the GM:ShutDown hook, as it may be too late to start saving data as some players will become invalid which means that their precious token count is now lost. Do not wait until the player leaves to save the number of tokens that they have earned whilst playing, as the server may suffer a fatal crash before then. Therefore, you should deal with the data as quickly as possible to avoid losing it. Unfortunately, Garry's mod servers aren't predictable - they can easily crash without warning or become overloaded. In case you couldn't tell, there is an over-arching theme here: Never trust the client. This is why we must use identification such as Player:SteamID's, since they can never be changed by the client. If we wanted to store a client's health when they log off, and we used their steam names as identification, what's stopping them from changing it before they next log on? Nothing. Let's say we started letting clients keep track of their money what's stopping them from adding a few zeros on the end?Īlways use identification that the client can't manipulate. Keep all data backed up on the server as this is the only way that you can be sure that the data is authentic. Never trust data that has been handled by a client. When handling any data, there are some rules that we should follow: In this tutorial, we will go over File Based Storage. There are multiple ways of storing data in Garry's Mod.

gmod file types

If you need to give data to the client, make sure to keep a backup of it on the server! Only store, save, change, and load data from the server.

gmod file types

util // or, with ES6 import gff from const util = gff. There is also a util module that contains super-low-level functions for dealing with lines and parts of lines.

gmod file types

Returns Promise promise for null that resolves when the stream has been written About util createReadStream ( 'path/to/my/file.gff3' ). default // or in ES6 (recommended) import gff from const fs = require ( 'fs' ) // parse a file from a file name // parses only features and sequences by default, // set options to parse directives and/or comments fs.













Gmod file types