viewing paste ra_msg_conf_comon | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: conf/msg_athena.conf
--- conf/msg_athena.conf Base (BASE)
+++ conf/msg_athena.conf Locally Modified (Based On LOCAL)
@@ -463,9 +463,13 @@
 508: This player hasn't been banned (Ban option is disabled).
 //509 Available....
 
-// mail system
+// mail system /auction
 //----------------------
 510: You have %d new emails (%d unread)
+520: Thanks, you won the auction!.
+521: Payment for your auction!.
+522: No buyers have been found for your auction.
+523: Auction Manager
 
 // Bot detect messages (currently unused)
 535: Possible use of BOT (99%% of chance) or modified client by '%s' (account: %d, char_id: %d). This player ask your name when you are hidden.
 
Index: src/char/char.c
--- src/char/char.c Base (BASE)
+++ src/char/char.c Locally Modified (Based On LOCAL)
Index: src/char/char.h
--- src/char/char.h Base (BASE)
+++ src/char/char.h Locally Modified (Based On LOCAL)
@@ -6,6 +6,7 @@
 
 #include "../config/core.h"
 #include "../common/core.h" // CORE_ST_LAST
+#include "../common/msg_conf.h"
 
 enum E_CHARSERVER_ST
 {
Index: src/char/int_auction.c
--- src/char/int_auction.c Base (BASE)
+++ src/char/int_auction.c Locally Modified (Based On LOCAL)
@@ -145,12 +145,12 @@
    {
        if( auction->buyer_id )
        {
-           mail_sendmail(0, "Auction Manager", auction->buyer_id, auction->buyer_name, "Auction", "Thanks, you won the auction!.", 0, &auction->item);
+           mail_sendmail(0, msg_txt(523), auction->buyer_id, auction->buyer_name, "Auction", msg_txt(520), 0, &auction->item);
            mapif_Auction_message(auction->buyer_id, 6); // You have won the auction
-           mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "Payment for your auction!.", auction->price, NULL);
+           mail_sendmail(0, msg_txt(523), auction->seller_id, auction->seller_name, "Auction", msg_txt(521), auction->price, NULL);
        }
        else
-           mail_sendmail(0, "Auction Manager", auction->seller_id, auction->seller_name, "Auction", "No buyers have been found for your auction.", 0, &auction->item);
+           mail_sendmail(0, msg_txt(523), auction->seller_id, auction->seller_name, "Auction", msg_txt(522), 0, &auction->item);
        
        ShowInfo("Auction End: id %u.\n", auction->auction_id);
 
Index: src/char/inter.c
--- src/char/inter.c Base (BASE)
+++ src/char/inter.c Locally Modified (Based On LOCAL)
@@ -8,6 +8,7 @@
 #include "../common/showmsg.h"
 #include "../common/socket.h"
 #include "../common/timer.h"
+#include "../common/conf.h"
 #include "char.h"
 #include "inter.h"
 #include "int_party.h"
@@ -67,70 +68,6 @@
 static DBMap* wis_db = NULL; // int wis_id -> struct WisData*
 static int wis_dellist[WISDELLIST_MAX], wis_delnum;
 
-#define MAX_JOB_NAMES 106
-static char* msg_table[MAX_JOB_NAMES]; //  messages 550 ~ 655 are job names
-
-const char* msg_txt(int msg_number) {
-   msg_number -= 550;
-   if (msg_number >= 0 && msg_number < MAX_JOB_NAMES &&
-       msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
-       return msg_table[msg_number];
-
-   return "Unknown";
-}
-
-/*==========================================
- * Read Message Data -- at char server we only keep job names.
- *------------------------------------------*/
-int msg_config_read(const char* cfgName) {
-   int msg_number;
-   char line[1024], w1[1024], w2[1024];
-   FILE *fp;
-   static int called = 1;
-
-   if ((fp = fopen(cfgName, "r")) == NULL) {
-       ShowError("Messages file not found: %s\n", cfgName);
-       return 1;
-   }
-
-   if ((--called) == 0)
-       memset(msg_table, 0, sizeof(msg_table[0]) * MAX_JOB_NAMES);
-
-   while(fgets(line, sizeof(line), fp) ) {
-       if (line[0] == '/' && line[1] == '/')
-           continue;
-       if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
-           continue;
-
-       if (strcmpi(w1, "import") == 0)
-           msg_config_read(w2);
-       else {
-           msg_number = atoi(w1);
-           if( msg_number < 550 || msg_number > (550+MAX_JOB_NAMES) )
-               continue;
-           msg_number -= 550;
-           if (msg_number >= 0 && msg_number < MAX_JOB_NAMES) {
-               if (msg_table[msg_number] != NULL)
-                   aFree(msg_table[msg_number]);
-               msg_table[msg_number] = (char *)aMalloc((strlen(w2) + 1)*sizeof (char));
-               strcpy(msg_table[msg_number],w2);
-           }
-       }
-   }
-
-   fclose(fp);
-
-   return 0;
-}
-
-/*==========================================
- * Cleanup Message Data
- *------------------------------------------*/
-void do_final_msg(void) {
-   int i;
-   for (i = 0; i < MAX_JOB_NAMES; i++)
-       aFree(msg_table[i]);
-}
 /* from pc.c due to @accinfo. any ideas to replace this crap are more than welcome. */
 const char* job_name(int class_) {
    switch (class_) {
@@ -791,7 +728,6 @@
    inter_auction_sql_init();
 
    geoip_readdb();
-   msg_config_read("conf/msg_athena.conf");
    return 0;
 }
 
@@ -811,8 +747,6 @@
    inter_auction_sql_final();
 
    if (accreg_pt) aFree(accreg_pt);
-
-   do_final_msg();
    return;
 }
 
Index: src/common/Makefile.in
--- src/common/Makefile.in Base (BASE)
+++ src/common/Makefile.in Locally Modified (Based On LOCAL)
@@ -3,7 +3,8 @@
    obj_all/nullpo.o obj_all/malloc.o obj_all/showmsg.o obj_all/strlib.o obj_all/utils.o \
    obj_all/grfio.o obj_all/mapindex.o obj_all/ers.o obj_all/md5calc.o \
    obj_all/minicore.o obj_all/minisocket.o obj_all/minimalloc.o obj_all/random.o obj_all/des.o \
-   obj_all/conf.o obj_all/thread.o obj_all/mutex.o obj_all/raconf.o obj_all/mempool.o
+   obj_all/conf.o obj_all/thread.o obj_all/mutex.o obj_all/raconf.o obj_all/mempool.o \
+   obj_all/msg_conf.o
 
 COMMON_H = $(shell ls ../common/*.h)
 
Index: src/common/conf.c
--- src/common/conf.c Base (BASE)
+++ src/common/conf.c Locally Modified (Based On LOCAL)
@@ -3,8 +3,8 @@
 
 #include "conf.h"
 #include "libconfig.h"
+#include "showmsg.h" // ShowError
 
-#include "../common/showmsg.h" // ShowError
 
 int conf_read_file(config_t *config, const char *config_filename)
 {
Index: src/common/conf.h
--- src/common/conf.h Base (BASE)
+++ src/common/conf.h Locally Modified (Based On LOCAL)
@@ -7,6 +7,10 @@
 #include "../common/cbasetypes.h"
 #include "libconfig.h"
 
+const char* msg_txt(int msg_number);
+int msg_config_read(const char* cfgName);
+void do_final_msg(void);
+
 int conf_read_file(config_t *config, const char *config_filename);
 int config_setting_copy(config_setting_t *parent, const config_setting_t *src);
 
Index: src/common/core.c
--- src/common/core.c Base (BASE)
+++ src/common/core.c Locally Modified (Based On LOCAL)
@@ -1,17 +1,19 @@
 // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
 // For more information, see LICENCE in the main folder
 
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/malloc.h"
+#include "mmo.h"
+#include "showmsg.h"
+#include "malloc.h"
 #include "core.h"
+#include "msg_conf.h"
+
 #ifndef MINICORE
-#include "../common/db.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-#include "../common/thread.h"
-#include "../common/mempool.h"
-#include "../common/sql.h"
+    #include "db.h"
+    #include "socket.h"
+    #include "timer.h"
+    #include "thread.h"
+    #include "mempool.h"
+    #include "sql.h"
 #endif
 
 #include <stdio.h>
@@ -324,6 +326,7 @@
    mempool_init();
    db_init();
    signals_init();
+   msg_config_read("conf/msg_athena.conf");
 
 #ifdef _WIN32
    cevents_init();
@@ -341,8 +344,8 @@
            do_sockets(next);
        }
    }
-
    do_final();
+   do_final_msg();
 
    timer_final();
    socket_final();
Index: src/common/msg_conf.c
--- src/common/msg_conf.c No Base Revision
+++ src/common/msg_conf.c Locally New
@@ -0,0 +1,78 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "malloc.h"
+#include "msg_conf.h"
+#include "showmsg.h"
+
+#define MAX_MSG 1500
+
+static char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
+
+//-----------------------------------------------------------
+// Return the message string of the specified number by [Yor]
+//-----------------------------------------------------------
+const char* msg_txt(int msg_number)
+{
+   if (msg_number >= 0 && msg_number < MAX_MSG &&
+       msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
+       return msg_table[msg_number];
+
+   return "??";
+}
+
+/*==========================================
+ * Read Message Data
+ *------------------------------------------*/
+int msg_config_read(const char* cfgName)
+{
+   int msg_number;
+   char line[1024], w1[1024], w2[1024];
+   FILE *fp;
+   static int called = 1;
+
+   if ((fp = fopen(cfgName, "r")) == NULL) {
+       ShowError("Messages file not found: %s\n", cfgName);
+       return 1;
+   }
+
+   if ((--called) == 0)
+       memset(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG);
+
+   while(fgets(line, sizeof(line), fp))
+   {
+       if (line[0] == '/' && line[1] == '/')
+           continue;
+       if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
+           continue;
+
+       if (strcmpi(w1, "import") == 0)
+           msg_config_read(w2);
+       else
+       {
+           msg_number = atoi(w1);
+           if (msg_number >= 0 && msg_number < MAX_MSG)
+           {
+               if (msg_table[msg_number] != NULL)
+                   aFree(msg_table[msg_number]);
+               msg_table[msg_number] = (char *)aMalloc((strlen(w2) + 1)*sizeof (char));
+               strcpy(msg_table[msg_number],w2);
+           }
+       }
+   }
+
+   fclose(fp);
+
+   return 0;
+}
+
+/*==========================================
+ * Cleanup Message Data
+ *------------------------------------------*/
+void do_final_msg(void)
+{
+   int i;
+   for (i = 0; i < MAX_MSG; i++)
+       aFree(msg_table[i]);
+}
Index: src/common/msg_conf.h
--- src/common/msg_conf.h No Base Revision
+++ src/common/msg_conf.h Locally New
@@ -0,0 +1,20 @@
+// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#ifndef MSG_CONF_H
+#define    MSG_CONF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const char* msg_txt(int msg_number);
+int msg_config_read(const char* cfgName);
+void do_final_msg(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MSG_CONF_H */
+
Index: src/map/atcommand.c
--- src/map/atcommand.c Base (BASE)
+++ src/map/atcommand.c Locally Modified (Based On LOCAL)
@@ -52,9 +52,7 @@
 
 #define ATCOMMAND_LENGTH 50
 #define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message)
-#define MAX_MSG 1500
 
-
 typedef struct AtCommandInfo AtCommandInfo;
 typedef struct AliasInfo AliasInfo;
 
@@ -76,7 +74,6 @@
 char atcommand_symbol = '@'; // first char of the commands
 char charcommand_symbol = '#';
 
-static char* msg_table[MAX_MSG]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
 static DBMap* atcommand_db = NULL; //name -> AtCommandInfo
 static DBMap* atcommand_alias_db = NULL; //alias -> AtCommandInfo
 static config_t atcommand_config;
@@ -100,73 +97,6 @@
    return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL;
 }
 
-//-----------------------------------------------------------
-// Return the message string of the specified number by [Yor]
-//-----------------------------------------------------------
-const char* msg_txt(int msg_number)
-{
-   if (msg_number >= 0 && msg_number < MAX_MSG &&
-       msg_table[msg_number] != NULL && msg_table[msg_number][0] != '\0')
-       return msg_table[msg_number];
-
-   return "??";
-}
-
-/*==========================================
- * Read Message Data
- *------------------------------------------*/
-int msg_config_read(const char* cfgName)
-{
-   int msg_number;
-   char line[1024], w1[1024], w2[1024];
-   FILE *fp;
-   static int called = 1;
-
-   if ((fp = fopen(cfgName, "r")) == NULL) {
-       ShowError("Messages file not found: %s\n", cfgName);
-       return 1;
-   }
-
-   if ((--called) == 0)
-       memset(msg_table, 0, sizeof(msg_table[0]) * MAX_MSG);
-
-   while(fgets(line, sizeof(line), fp))
-   {
-       if (line[0] == '/' && line[1] == '/')
-           continue;
-       if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) != 2)
-           continue;
-
-       if (strcmpi(w1, "import") == 0)
-           msg_config_read(w2);
-       else
-       {
-           msg_number = atoi(w1);
-           if (msg_number >= 0 && msg_number < MAX_MSG)
-           {
-               if (msg_table[msg_number] != NULL)
-                   aFree(msg_table[msg_number]);
-               msg_table[msg_number] = (char *)aMalloc((strlen(w2) + 1)*sizeof (char));
-               strcpy(msg_table[msg_number],w2);
-           }
-       }
-   }
-
-   fclose(fp);
-
-   return 0;
-}
-
-/*==========================================
- * Cleanup Message Data
- *------------------------------------------*/
-void do_final_msg(void)
-{
-   int i;
-   for (i = 0; i < MAX_MSG; i++)
-       aFree(msg_table[i]);
-}
-
 /**
  * retrieves the help string associated with a given command.
  *
Index: src/map/atcommand.h
--- src/map/atcommand.h Base (BASE)
+++ src/map/atcommand.h Locally Modified (Based On LOCAL)
@@ -30,10 +30,6 @@
 
 bool atcommand_exists(const char* name);
 
-const char* msg_txt(int msg_number);
-int msg_config_read(const char* cfgName);
-void do_final_msg(void);
-
 extern int atcmd_binding_count;
 
 // @commands (script based)
Index: src/map/map.c
--- src/map/map.c Base (BASE)
+++ src/map/map.c Locally Modified (Based On LOCAL)
@@ -3594,7 +3594,6 @@
    do_final_pc();
    do_final_pet();
    do_final_mob();
-   do_final_msg();
    do_final_skill();
    do_final_status();
    do_final_unit();
@@ -3873,7 +3872,7 @@
    }
 
    battle_config_read(BATTLE_CONF_FILENAME);
-   msg_config_read(MSG_CONF_NAME);
+
    script_config_read(SCRIPT_CONF_NAME);
    inter_config_read(INTER_CONF_NAME);
    log_config_read(LOG_CONF_NAME);
Index: src/map/map.h
--- src/map/map.h Base (BASE)
+++ src/map/map.h Locally Modified (Based On LOCAL)
@@ -9,6 +9,7 @@
 #include "../common/mmo.h"
 #include "../common/mapindex.h"
 #include "../common/db.h"
+#include "../common/msg_conf.h"
 
 /**
  * [rAthena.org]
 
 //Walk intervals at which chase-skills are attempted to be triggered.
Index: tools/config.pl
--- tools/config.pl Base (BASE)
+++ tools/config.pl Locally Modified (Based On LOCAL)
@@ -2,6 +2,9 @@
 # config script by lighta
 #TODO list :
 #- don't always override import/file, sed grep ?
+#- auto apply updates .sql check version main, log
+#- auto enable coredump
+#- auto enable backup
\ No newline at end of file
 
 use CPAN;
 use strict;
Viewed 1472 times, submitted by lighta.