I am trying to use an online gameINI as a level portal for user made levels, however when I write to it or even manually add a section to the ini on the website, it doesn't appear on the webpage immediately, even after refreshing the page. I thought it wasn't working at all, but after attempting to upload a level several days ago, I came back today to find it fully uploaded and working. Is there a way to force sync the update, or is there a reason it isn't instantaneous?
Hey! So I'm working on making a custom chat system with Game INIs, and I think I keep hitting the size limit really quickly, or maybe the players update the INIs too often, even without that many messages being used, and it gives the players an error after a few messages have been sent. The system I'm using is basically whenever a player sends a message, it goes through a for loop and changes all of the game INI keys to the INI key below, and then changes the first one to the message the player sent. Is there any way this system could be optimized, or would it be more efficient using a different GMServer data storage method, like binary data blocks maybe? Thank You! And I'm sorry if I'm ignorant to some obvious reason this wouldn't work, I'm still learning a lot about implementing multiplayer and everything haha.
Now that I'm checking it over, it may have something to do with the way I'm drawing them aswell, in the draw event it checks if the ini exists and then reads the ini, maybe since this is happening every step it is giving an error after a certain time. I'm not sure if that's how it would work, but that's the only other thing that I could think of.
INIs are cached, so reading it every step should not be a problem.
Though please consider using the built-in chat system, as it's much more efficient than any of the other features in the extension that you could try to use as a chat system. If you just want to draw your own chat, you can do that with the built-in chat system too, see for example gms_chat_get_text and gms_chat_get_sendername.
Is there any way to check whether it has successfully read the ini or written the ini so that we may take next step accordingly? Like you said reading it each step is not possible so we need to know when it's done.
Reading is always instant, since INI files are downloaded upon connecting or logging in, not when calling gms_ini_*_read. So as soon as gms_info_isconnected or gms_info_isloggedin returns true, you know that the GameINI and PlayerINI are available, respectively.
If you have values that change once every ~3-5 seconds or slower, just save the new value to the INI every time. It's not really worthwhile to figure out when exactly the values are saved, as long as you're still connected to the server (gms_info_isconnected).
If you do need to know when an INI write has been fully processed, and this is a big ugly hacky way to do this so don't do it if you don't have to, is to open an empty BDB after issuing the gms_ini_*_write commands. Since functions you execute are sent in order to the server, you can use opening a BDB as a sort of indicator of when everything you've sent before the gms_bdb_open request has been processed. So just open a BDB non-exclusively, and when the callback is called you know that everything you did before the open has been processed.
I would use the build-in chat system, however, there is no way of saving the history of the chat (that I know of, I may be just looking it over somehow) so I can review it.
I also do not like how I'm limited to the amount of chat messages I can send in a certain amount of time, to prevent spam, even though I'm set as an administrator for my game. Overall, I'd really like more control, and coding the chat system myself would give me that control.
For now, I'll use the built in chat system though, it would be really awesome if you considered some alternative way/more efficient way in the overhaul of game maker server to program your own chat system, or have more control over the chat system.
I dunno if you are still active here, but a good way to do it is store the values in the ini separated by commas or something like "value1,value2,value3,value4,value5", pull the data, split it at the commas, and store them in an array, then you can loop through the array and get the data needed, all in one key too.
How long does it take for a game ini to show up on the site?
As mentioned by someone else I am also making a level portal for player created levels,
I used gms_ini_game_write about half hour ago and it's still not showing up under the ini game section.
How long does it usually take? because I have a script that checks if the ini exists because if it does I want to delete the ini before rewriting it to make sure it isn't posted twice and I can't check if the ini has been posted if it takes over an hour to actually post :/
Or would posting an ini under the same section and key write over it the old one anyway, even if it is delayed?
Sorry for the awkward question, thanks!