Raised This Month: $32 Target: $400
 8% 

[Sven Co-op] Static.cfg restoration


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-26-2016 , 10:57   Re: Static.cfg restoration
Reply With Quote #11

We are here to discuss, so don't worry.

Quote:
In Sven Co-op, mapcycles in the servers are huge! Since very few of them only run stock maps, the mapcycle of a regular server can easily be over 100 maps (mine is almost reaching 200 maps in the cycle). This is unlike a game like Counter-Strike where I haven't seen a server with more than 20 maps in their cycle.
You don't quite understand how your read the file into the buffer. When looping, you read line by line, so in the buffer you will store only one map at a time. It does't matter if you have 100 of them or 9999999, plugin will process them one by one.
Let's say you have a file like:
Code:
map1
map2
map3
When you do while(!feof(f)) fgets(f,...) in data you firstly store map1, then map2 and so on. And given that engine use 32 for map max length, 64 is a waste of resources.

Quote:
I do not understand what do you really mean here.
I had the impression you always loop and read the file, was confused by tasks. Sorry.

Then, you only apply the cvars one time, isn't this an issue? Because they may be changed again after you apply them.

Quote:
What's the difference between that okapi method and https://forums.alliedmods.net/showthread.php?t=154642 this module?
Basically no difference, I have the impression that Cvar Util module also hooks such functions, but not sure if it supports sven coop 5. Also Arkshine does not recommend using the module anymore, so you should just use what I gave you.

Any other questions?
__________________

Last edited by HamletEagle; 04-26-2016 at 10:59.
HamletEagle is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-09-2016 , 09:48   Re: Static.cfg restoration
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
You don't quite understand how your read the file into the buffer. [...]
Yes, I misunderstood what were you saying. I'm sorry.

Let's try with this, I made a ton of improvements. And I hope I haven't miss anything.
I decided to go with Cvar Utilities, so it requires that module to work.

It is not tested though, I will update the main post when I have the opportunity to test it.
Attached Files
File Type: sma Get Plugin or Get Source (static_cfg_restoration.sma - 635 views - 2.6 KB)
__________________
gabuch2 is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-10-2016 , 16:00   Re: Static.cfg restoration
Reply With Quote #13

Sadly, neither Cvar Utils or Okapi methods work in Sven Co-op 5 (probably they changed the OnCvarDirectSet offset?)

PHP Code:
public OnCvar_DirectSet(const CvarHandle, const CvarValue[])
{
    
log_amx("[STATIC] Something changed a cvar...") << this never gets called

[...] 
Attached Files
File Type: sma Get Plugin or Get Source (static_cfg_restoration.sma - 622 views - 4.6 KB)
__________________
gabuch2 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-13-2016 , 08:52   Re: Static.cfg restoration
Reply With Quote #14

I am not surprised that cvar util does not work, I told you it needs signatures to work and module was made before last update to sven coop.
What I gave you is tested and works. What's the build of your server? I got the latest one from steamcmd:

Code:
] version
Protocol version 48
Exe version 5.0.0.0 (svencoop)
Exe build: 20:47:20 Feb 25 2016 (7063)
What cvars did you change?
__________________
HamletEagle is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-13-2016 , 10:04   Re: Static.cfg restoration
Reply With Quote #15

Quote:
Originally Posted by HamletEagle View Post
I am not surprised that cvar util does not work, I told you it needs signatures to work and module was made before last update to sven coop.
What I gave you is tested and works. What's the build of your server? I got the latest one from steamcmd:

Code:
] version
Protocol version 48
Exe version 5.0.0.0 (svencoop)
Exe build: 20:47:20 Feb 25 2016 (7063)
What cvars did you change?
Code:
version
Protocol version 48
Exe version 5.0.0.0 (svencoop)
Exe build: 20:22:32 Feb 26 2016 (7064)
Code:
amxx modules
Currently loaded modules:
      name                    version     author               status
 [ 1] FakeMeta                1.8.2       AMX Mod X Dev Team   running
 [ 2] Fun                     1.8.2       AMX Mod X Dev Team   running
 [ 3] MySQL                   1.8.2       AMX Mod X Dev Team   running
 [ 4] Engine                  1.8.2       AMX Mod X Dev Team   running
 [ 5] okapi                   1.0         joaquimandrade       running
 [ 6] GeoIP                   1.2.0-manu  AMX Mod X Dev Team   running
 [ 7] Ham Sandwich            1.8.2       AMX Mod X Dev Team   running
 [ 8] Sockets                 1.8.2       HLSW Dev Team        running
I put a log message as soon any cvar (supposedly) changes so I can know it's hooking correctly, but for some reason it doesn't. Check the latest .sma attachment, maybe I missed something.
__________________
gabuch2 is offline
Old 05-13-2016, 10:09
HamletEagle
This message has been deleted by HamletEagle.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-15-2016 , 09:24   Re: Static.cfg restoration
Reply With Quote #16

Just made some tests, it seems you should move the code for hooking from init to precache to catch all changes.
__________________

Last edited by HamletEagle; 05-15-2016 at 09:24.
HamletEagle is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-24-2016 , 15:06   Re: Static.cfg restoration
Reply With Quote #17

Unfortunately I can't make this work. If your method works for you I must really be missing something, but I can't see what.

Reverting to the old method and updating the main thread.
Attached Files
File Type: sma Get Plugin or Get Source (static_cfg_restoration.sma - 105 views - 4.9 KB)
__________________
gabuch2 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-27-2016 , 06:06   Re: Static.cfg restoration
Reply With Quote #18

Can you give me a few examples of such cvars?
__________________
HamletEagle is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 06-28-2016 , 11:49   Re: Static.cfg restoration
Reply With Quote #19

Quote:
Originally Posted by HamletEagle View Post
Can you give me a few examples of such cvars?
Sorry I don't quite understand this question.

Do you want an example of what this plugin able to do?
__________________
gabuch2 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-29-2016 , 05:34   Re: Static.cfg restoration
Reply With Quote #20

I am asking for your testing steps. Maybe I'm overlooking something, since I don't know much about svencoop.
With what I gave you, when I do for example amx_cvar some_cvar value I get the message that the change was hooked.
__________________
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode