Jump to content

Mod Functions in TheNet


Recommended Posts

Hey everybody, my brother and I are currently attempting to modify mods from inside a server(so far non-dedicated). We are already capable of making a modified type of modsscreen screen appear in the game and are able to enable and disable mods. Whenever we enable/disable mods in-game(so far only single player works, others crash when joining), the game will save and restart and appear as if the mods have been changed normally, but it does not seem like it is updating the list of mods internally. Someone looking at the server details from another computer will only see the mods that the world first loaded with. For example, if a server starts with Combined Status enabled and we disable it, the world will no longer show it, but the mods list and scoreboard will still show Combined Status as though it were enabled. 

We are currently searching for a way to update the list of enabled mods everywhere in the game. We tried to find functions that update mod listings for a server and found one in playerstatusscreen.lua in scripts/screens that might be useful called TheNet:GetServerModsDescription(). (Btw we know something about saving the KnownModIndex but it doesn't update anything. Our end goal is make changing mods as easy as if you were outside the server)

Question: So right now the question is whether there are any functions in TheNet (which is not defined in any of the game files) that could help us refresh the mod listing on every level to make sure changes are global. A follow up question could be where a list of TheNet functions is located. We know it is related to the C++ that runs in the background so this may be a bit of a challenge.

Please check out the modmain on our git repository; it's really short: https://github.com/rawii22/IngameModManager

Edited by rawii22
Link to comment
Share on other sites

So when you disable/enable a mod in game and exit the server, that change reflects in the Mods Tab? If it does, it would make sense that it would no longer be listed.

Also, there isn't really a documented list of TheNet functions. But here are all the ones I know of for DST.
global TheNet: {
DeleteUserSession: function,
Disconnect: function,
DownloadServerDetails: function,
GetClientTable: function,
GetClientTableForUser: function,
GetDefaultClanAdmins: function,
GetDefaultClanID: function,
GetDefaultClanOnly: function,
GetDefaultEncodeUserPath: function,
GetDefaultFriendsOnlyServer: function,
GetDefaultGameMode: function,
GetDefaultLANOnlyServer: function,
GetDefaultMaxPlayers: function,
GetDefaultPvpSetting: function,
GetDefaultServerDescription: function,
GetDefaultServerIntention: function,
GetDefaultServerLanguage: function,
GetDefaultServerName: function,
GetDefaultServerPassword: function,
GetIsClient: function,
GetIsServer: function,
GetServerClanID: function,
GetServerDescription: function,
GetServerGameMode: function,
GetServerIsClientHosted: function,
GetServerListingFromActualIndex: function,
GetServerListingReadDirty: function,
GetServerListings: function,
GetServerMaxPlayers: function,
GetServerModsDescription: function,
GetServerModsEnabled: function,
GetServerName: function,
GetUserID: function,
GetWorldSessionFile: function,
GetWorldSessionFileInClusterSlot: function,
IsDedicated: function,
IsDedicatedOfflineCluster: function,
IsOnlineMode: function,
IsSearchingServers: function,
IsVoiceActive: function,
JoinServerResponse: function,
Kick: function,
ReportListing: function,
SearchLANServers: function,
SearchServers: function,
SerializeUserSession: function,
SerializeWorldSession: function,
ServerModsDownloadCompleted: function,
SetCheckVersionOnQuery: function,
SetPlayerMuted: function,
SetServerTags: function,
SetWorldGenData: function,
StartClient: function,
StartServer: function,
StopSearchingServers: function,
TruncateSnapshots: function,
TryDefaultEncodeUserPath: function,
ViewNetProfile: function,
}

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...