Grish44 / q2jump-global-integration

Quake 2 Jump mod enhanced to support scores/times from multiple remote servers
4 stars 2 forks source link

Compile fixes #1

Open incith opened 1 year ago

incith commented 1 year ago

I'm still learning git but here is a diff file until I can learn pull requests!

Multiple definitions of ESF_debug and html_data

If this could be done better please let me know. Still learning.

diff --git a/g_local.h b/g_local.h
index d03d8bf..ee9d93a 100644
--- a/g_local.h
+++ b/g_local.h
@@ -1342,10 +1342,10 @@ struct edict_s

 };

-int ESF_debug;
+extern int ESF_debug;

 //ZOID
 #include "g_ctf.h"
 //ZOID
 #include "jumpmod.h"
-#include "global.h"
\ No newline at end of file
+#include "global.h"
diff --git a/jumpmod.c b/jumpmod.c
index 93daf20..610352b 100644
--- a/jumpmod.c
+++ b/jumpmod.c
@@ -15,7 +15,7 @@
 #include <stdlib.h>
 #include <string.h>

-
+html_data_t html_data;
 int curclients = 0;
 int activeclients = 0;
 int map_added_time = 0;
diff --git a/jumpmod.h b/jumpmod.h
index ce750d5..035170b 100644
--- a/jumpmod.h
+++ b/jumpmod.h
@@ -747,7 +747,7 @@ typedef struct {
        char tplate[SIZEOF_HTML_BUFFER];
        int len;
 } html_data_t;
-html_data_t html_data;
+//html_data_t html_data;

 #define HTML_TEMPLATE_POSITION "$template_position$"
 #define HTML_TEMPLATE_MAPBESTTIME "$template_mapbesttime$"
diff --git a/p_client.c b/p_client.c
index fbeca5d..2a2b3c5 100644
--- a/p_client.c
+++ b/p_client.c
@@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 //#include "p_hook.h"
 #include "m_player.h"

+int ESF_debug;
+
 void SP_misc_teleporter_dest (edict_t *ent);

 //
incith commented 1 year ago

Just going to tie on to this - I set the global_integration_enabled and everything in my config but global integration states it is disabled.

So I forced setting it in JumpMod.c and that seems to be working lol.

I would love to get an example(s) of how to configure manual.ini, admin.cfg, etc, the misc files, so I can use gset properly. But I still find it odd that the global* settings in my cfg seem to be ignored.

Thank you for the amazing work!

incith commented 1 year ago

Ok, I've discovered I needed to add those variables specifically to jump_mod.cfg -- that's working great now. My bad. I had assumed jumpmod.cfg was just the generic server file name in the documents and I typically use server.cfg. So adding just the global vars to jump_mod.cfg is working as intended.

I believe I understand how admin.cfg works that also seems straightforward.

I cannot for the life of me determine what manual.ini is for. And beyond that just the compile fix above.

Edit: I can only seem to get global_integration_enabled if I force it in jumpmod.c. It seems to read the global_url stuff at startup but it doesn't enable integration no matter what I put in jump_mod.cfg.