

aakarsh98
Membro AvançadoTipo de Conteúdo
Perfis
Fóruns
Atualizações
Quizzes
Store
Tudo que aakarsh98 postou
-
void sendranking2(const int conn) { if (pMob[conn].MOB.CurrentScore.Level < 1000) { auto mob = GetMobFromIndex(conn); auto user = GetUserFromIndex(conn); int totalkill = GetTotKill(conn); int curkill = GetCurKill(conn); int altar = pMob[conn].extra.score; int wins = pMob[conn].extra.scorewins; if (wins <= 0) wins = 0; char dir[100]; time_t now = time(0); tm when; localtime_s(&when, &now); int score = 0; FILE* fp; if (mob->extra.ClassMaster == MORTAL) { sprintf_s(dir, "../../Common/RankingApp/Ranking2/%s.txt", mob->MOB.MobName); } else { sprintf_s(dir, "../../Common/RankingApp/Ranking2/%s_.txt", mob->MOB.MobName); } fopen_s(&fp, dir, "w"); int Evolucao = 0; int sub = 0; int slot = pUser[conn].Slot; if (mob->extra.ClassMaster == MORTAL) Evolucao = 0; if (mob->extra.ClassMaster == ARCH) Evolucao = 1; if (mob->extra.ClassMaster == CELESTIAL) Evolucao = 2; if (mob->extra.ClassMaster == CELESTIALCS || mob->extra.ClassMaster == SCELESTIAL) { Evolucao = 3; sub = 1; } int levelranking = mob->MOB.CurrentScore.Level * 3 + 1; score = wins + altar; if (Evolucao == 2) score += 0; if (Evolucao == 3) score += 0; if (Evolucao == 4) score += 0; int mobclan = mob->MOB.Clan; if (pMob[conn].extra.clanmode == 1) { mobclan = 9; } else if (pMob[conn].extra.clanmode == 2) { mobclan = 10; } if (fp == NULL) { printf("[Erro ao gerar ranking \n"); return; } else { fprintf_s(fp, "%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", mob->MOB.MobName, mob->MOB.CurrentScore.Level, mob->MOB.Class, Evolucao, mobclan, mob->MOB.Guild, mob->MOB.GuildLevel, score, totalkill, sub, mob->extra.QuestInfo.Celestial.SubCelestialLevel, mob->extra.QuestInfo.Celestial.CelestialLevel, slot); fclose(fp); return; } } return; } trying to implement this to send data to me website need help. also how do i use the mysql functions to actively update data between db server and my sql data base.
-
can you share that tool please.
-
unfortunately its not that simple.
-
I have been trying to figure out how to change/set item icon for various items in the item list, one example is item 751 which is the dragon emblem, in the itemlist.csv its associated to icon 47 in the csv document, when i open the itemicon.bin its set to 132 when i open itemicon01.wyt, the icon is situated in 2nd row 7th column, i am confused, if someone can help me understand this better, it will be helpful.
-
Existe release 7.54 pronta para produção e/ou pura?
aakarsh98 respondeu ao pergunta de 987987987 em WYD - Dúvidas
i am interested in one as well. -
wish that is possible in all the client versions, finding source codes is so tough.
-
nvm, the function calls were using API, thank you all for the suggestions.
-
I think i did not communicate correctly, I did run and test the Telnet command on both my personal pc and vps, its connecting and receiving data from the hosting site. so now i am debugging the MySQL function within the source code to see how the functions are called and how its responding.
-
great, so i tested this and everything works, i even tested this on my own pc trying to connect and access the database. i think its the problem with the code or how it references it. this is the mysql.h header file #include <mysql.h> #include <stdint.h> #pragma comment(lib, "libmysql.lib") #include "singleton.h" #define HOST "localhost" #define USER "root" #define PASS "123456" #define PORT 3306 #define DB "wydsite" extern int contador; extern char xQuery[1000]; extern char mQuery[1000]; extern char hQuery[1000]; extern char xMsg[1000]; extern char xRow[400]; extern char xMAC[400]; extern char xIP[400]; extern char* xPass; class cSQL : public Singleton<cSQL> { protected: friend class Singleton<cSQL>; cSQL() {} virtual ~cSQL() {} cSQL(const cSQL&) = delete; cSQL& operator=(const cSQL&) = delete; public: static MYSQL* wStart(); static MYSQL_RES* wRes(MYSQL* sql, char* query); static bool wQuery(char* query); static char* wInfo(char* query); static int iInfo(char* query); static int Cont(char* query); static void wLog(char* acc, char* pers, char* mensagem, char* type); static long long lInfo(char* query); }; uint32_t convert(const char* name); lets assume that i have replaced the database values correctly. this file below is the .cpp that defines the function, i think its not efficently reading and updating data from the datbase when its hosted on another server, however when i was testing on local machine, it seems to work fine. so if anyone has suggestions on how to fix it , that would be nice. #include "Basedef.h" #include <Windows.h> #include <stdio.h> #include <fcntl.h> #include <time.h> #include <math.h> #include <io.h> #include <errno.h> #include "wMySQL.h" HANDLE hThread; HANDLE ThreadLog; unsigned long iID; int contador = 0; char xQuery[1000]; char mQuery[1000]; char hQuery[1000]; char xMsg[1000]; char xRow[400]; char xMAC[400]; char xIP[400]; char* xPass; unsigned long lID; MYSQL* cSQL::wStart() { MYSQL* wSQL = mysql_init(NULL); try { my_bool reconnect = 1; mysql_options(wSQL, MYSQL_OPT_RECONNECT, &reconnect); mysql_options(wSQL, MYSQL_OPT_COMPRESS, 0); mysql_options(wSQL, MYSQL_OPT_CONNECT_TIMEOUT, "300"); if (!mysql_real_connect(wSQL, HOST, USER, PASS, DB, PORT, NULL, 0)) { printf("[wMySQL][TMSVR] Ocorreu um erro na conexão.\n\t\tErro: %s\n", mysql_error(wSQL)); return wSQL; } return wSQL; } catch (...) { return wSQL; } } MYSQL_RES* cSQL::wRes(MYSQL* sql, char* query) { try { if (mysql_query(sql, query)) { printf("[wMySQL][wRes] Erro na execução da wRes.\nQuery: %s\n\t\tErro: %s\n", query, mysql_error(sql)); mysql_close(sql); return NULL; } MYSQL_RES* result = mysql_store_result(sql); mysql_close(sql); if (result) return result; return NULL; } catch (...) { return NULL; } } void cSQL::wLog(char* acc, char* pers, char* mensagem, char* type) { time_t rawtime; struct tm* timeinfo; time(&rawtime); timeinfo = localtime(&rawtime); sprintf(logQuery, "INSERT INTO `log` (`ID`, `Conta`, `Char`, `Mensagem`, `Data`, `Tipo`) VALUES(NULL, '%s', '%s', '%s', '%d/%d/%d %d:%d:%d', '%s')", acc, pers, mensagem, timeinfo->tm_mday, (timeinfo->tm_mon + 1), (timeinfo->tm_year + 1900), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, type); ////ThreadLog = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)wQuery, (void*)logQuery, 0, &lID); //cSQL::wQuery(xQuery); auto& pc = cSQL::instance(); MYSQL* wSQL = pc.wStart(); if (mysql_query(wSQL, logQuery)) { printf("[wMySQL][Log] Erro na execução da wQuery.\n\t\tErro: %s\n", mysql_error(wSQL)); mysql_close(wSQL); //ExitThread(0); return; } mysql_close(wSQL); printf("[%02d/%02d/%d][%02d:%02d:%02d][%s - %s] %s\n", timeinfo->tm_mday, (timeinfo->tm_mon + 1), (timeinfo->tm_year + 1900), timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec, acc, pers, mensagem); return; } /// Executes a query. bool cSQL::wQuery(char* query) { try { auto& pc = cSQL::instance(); MYSQL* wSQL = pc.wStart(); if (mysql_query(wSQL, query)) { printf("[wMySQL][wQuery] Erro na execução da wQuery.\n\t\tErro: %s\n", mysql_error(wSQL)); mysql_close(wSQL); //ExitThread(0); return FALSE; } mysql_close(wSQL); //ExitThread(0); return TRUE; } catch (...) { return FALSE; } } int cSQL::Cont(char* query) { int res = 0; auto& cnt = cSQL::instance(); MYSQL* wSQL = cnt.wStart(); MYSQL_RES* result = cnt.wRes(wSQL, query); if (result == NULL) { printf("[wMySQL][wInfo]: Ocorreu um erro ao retornar Dados.\n"); //mysql_free_result(sq.result); //mysql_close(sq.wSQL); return res; } res = (int)mysql_num_rows(result); mysql_free_result(result); mysql_close(wSQL); return res; } int cSQL::iInfo(char* query) { int res = 0; MYSQL_ROW row; auto& cnt = cSQL::instance(); MYSQL* wSQL = cnt.wStart(); MYSQL_RES* result = cnt.wRes(wSQL, query); if (result == NULL) { printf("[wMySQL][wInfo]: Ocorreu um erro ao retornar Dados.\n"); //mysql_free_result(sq.result); //mysql_close(sq.wSQL); return res; } while ((row = mysql_fetch_row(result)) != NULL) res = atoi(row[0]); mysql_free_result(result); mysql_close(wSQL); return res; } long long cSQL::lInfo(char* query) { long long res = 0; MYSQL_ROW row; auto& cnt = cSQL::instance(); MYSQL* wSQL = cnt.wStart(); MYSQL_RES* result = cnt.wRes(wSQL, query); if (result == NULL) { printf("[wMySQL][wInfo]: Ocorreu um erro ao retornar Dados.\n"); //mysql_free_result(sq.result); //mysql_close(sq.wSQL); return res; } while ((row = mysql_fetch_row(result)) != NULL) res = atoll(row[0]); mysql_free_result(result); mysql_close(wSQL); return res; } char* cSQL::wInfo(char* query) { MYSQL_ROW row; auto& cnt = cSQL::instance(); MYSQL* wSQL = cnt.wStart(); MYSQL_RES* result = cnt.wRes(wSQL, query); if (result == NULL) { printf("[wMySQL][wInfo]: Ocorreu um erro ao retornar Dados.\n"); //mysql_free_result(sq.result); //mysql_close(sq.wSQL); return (char*)"0"; } char res[1000]; memset(res, 0, sizeof(char)); while ((row = mysql_fetch_row(result)) != NULL) strcpy(res, row[0]); mysql_free_result(result); mysql_close(wSQL); return res; } uint32_t convert(const char* name) { uint32_t val = uint32_t(name[3]) + (uint32_t(name[2]) << 8) + (uint32_t(name[1]) << 16) + (uint32_t(name[0]) << 24); return val; }
-
can you help me out in pvt, i have put in the details correctly, but the main tm/db server doesnt seem to call and utilize it.
-
//#define HOST "localhost" //#define USER "root" //#define PASS "123456" //#define PORT 3306 //#define DB "wydsite" what should be the values when using a hosting service, through cpanel and myphp. need help setting this when the main server is on a different device/ip/vps adn the website/database is hosted on a different IP/domain.
-
This happens on server reset, and sometimes in the source code based on the date its set to reset.
-
i dont know how not to do that.
-
can you share the source code if possible please, its missing the bin to txt and txt to bin.
-
Not needed , you can try .
-
import struct import tkinter as tk from tkinter import filedialog, messagebox, simpledialog, ttk # Constants NUM_STRINGS = 2000 CHARS_PER_STRING = 128 # Read the binary file and return list of strings def read_strdef_bin(filepath): with open(filepath, 'rb') as f: data = f.read(NUM_STRINGS * CHARS_PER_STRING) strings = [data[i*CHARS_PER_STRING:(i+1)*CHARS_PER_STRING].decode('latin1').rstrip('\x00') for i in range(NUM_STRINGS)] return strings # Write the list of strings back to binary format def write_strdef_bin(filepath, strings): with open(filepath, 'wb') as f: for s in strings: encoded = s.encode('latin1')[:CHARS_PER_STRING] padded = encoded + b'\x00' * (CHARS_PER_STRING - len(encoded)) f.write(padded) # GUI application class class StrDefEditorApp: def __init__(self, root): self.root = root self.root.title("STRDEF.BIN Editor") self.file_path = "" self.strings = [] self.create_widgets() def create_widgets(self): frame = ttk.Frame(self.root) frame.pack(fill='both', expand=True) self.listbox = tk.Listbox(frame, font=('Courier', 10)) self.listbox.pack(side='left', fill='both', expand=True) self.listbox.bind('<<ListboxSelect>>', self.edit_string) scrollbar = tk.Scrollbar(frame) scrollbar.pack(side='right', fill='y') self.listbox.config(yscrollcommand=scrollbar.set) scrollbar.config(command=self.listbox.yview) menubar = tk.Menu(self.root) filemenu = tk.Menu(menubar, tearoff=0) filemenu.add_command(label="Open", command=self.open_file) filemenu.add_command(label="Save", command=self.save_file) menubar.add_cascade(label="File", menu=filemenu) self.root.config(menu=menubar) def open_file(self): path = filedialog.askopenfilename(filetypes=[("BIN files", "*.bin")]) if not path: return self.file_path = path self.strings = read_strdef_bin(path) self.listbox.delete(0, tk.END) for i, s in enumerate(self.strings): self.listbox.insert(tk.END, f"{i:04}: {s}") def save_file(self): if not self.file_path or not self.strings: return write_strdef_bin(self.file_path, self.strings) messagebox.showinfo("Saved", "Changes saved to file.") def edit_string(self, event): selection = self.listbox.curselection() if not selection: return index = selection[0] old_value = self.strings[index] new_value = simpledialog.askstring("Edit String", f"Edit string at index {index}:", initialvalue=old_value) if new_value is not None: self.strings[index] = new_value self.listbox.delete(index) self.listbox.insert(index, f"{index:04}: {new_value}") # Run the app def run_app(): root = tk.Tk() app = StrDefEditorApp(root) root.mainloop() run_app()
-
[Hidden Content] This happens all the time, dont know what is causing it. ------------------------------------------ >>> Logging system turn on. >> mark 04/13 13:05:29 - VertexShader HW Accel Enabled 04/13 13:05:29 - Error in Init Render Target Texture 04/13 13:05:40 - >> New Field Scene 04/13 13:05:40 - >> Init Field Scene::Start 04/13 13:05:40 - >> Init Field Scene::End 04/13 13:10:18 - mesh\\jwal24.msa , mesh\jwal24.ÍÍÍ 04/13 13:10:18 - mesh\\jwal26.msa , mesh\jwal26.ÍÍÍ 04/13 13:10:18 - mesh\\jwal27.msa , mesh\jwal27.ÍÍÍ 04/13 13:10:18 - mesh\\jwal25.msa , mesh\jwal25.ÍÍÍ 04/13 13:10:25 - effect\\fireeagle.msa , Effect\fireeagle.wys 04/13 13:10:40 - mesh\\track6.msa , mesh\track6.ÍÍÍ 04/13 13:13:22 - Contact Support MAPERROR: env\Field1616.trn 04/13 13:13:22 - ReadingError : mesh\\aawandtwo.msa i just checked the logs
-
thank you, translation I am figuring out, yes and for the changes, you are right gradual changes are better! if i can figure out how the handles are called in game , i can start messing around with the UI and GUI.
-
How to fix this error, started happening after i changed logo and a few other wyt files. how to change this text, did not find in ui string and other txt files. i want to translate this and make changes to the ui, for the love of god, i am unable to use the tools , I have both source code for server and client, learning to do the basic debugging, but no progress . was getting this error, so i fixed it in TM server, had an issue with do recall function.
-
some serverlist.bin are encrypted , how to decrypt them.
-
[Hidden Content] does anyone have this file!
-
thank you so much!, if it isnt too much, could you please give a quick tutorial on how to actually use the tool.
-
Can someone share this file please.
-
VENDA 🔥🔥🔥 Projeto + Site à Venda - WYD Mythology 2024 🔥🔥🔥
aakarsh98 respondeu ao tópico de DigDon em WYD - MarketPlace
Hi i added you on Discord, still waiting for you to accept so we can take the conversation further, do you also provide other additional systems on request ?