I found a big bug:
kalima 6: (correct monster skills)
Imageshack - screen081101010009.jpg
Imageshack - screen081101010010.jpg
kalima 7: (bugged, Energy Ball skill)
Imageshack - screen081100590001.jpg
WTF? I use monster.txt from shatter's files...
Printable View
I found a big bug:
kalima 6: (correct monster skills)
Imageshack - screen081101010009.jpg
Imageshack - screen081101010010.jpg
kalima 7: (bugged, Energy Ball skill)
Imageshack - screen081100590001.jpg
WTF? I use monster.txt from shatter's files...
Code://------------------------------------------------------------
//ŔŇľîąö¸°Ä®¸®¸¶
//------------------------------------------------------------
0
//Ăß°ˇ »óÁˇ NPC
259 36 0 7 19 2
end
2
331 36 30 30 75 -1
331 36 30 35 21 -1
331 36 30 28 17 -1
331 36 30 36 11 -1
331 36 30 51 11 -1
331 36 30 42 12 -1
331 36 30 45 22 -1
331 36 30 52 24 -1
331 36 30 53 17 -1
331 36 30 60 9 -1
332 36 30 67 22 -1
331 36 30 60 22 -1
332 36 30 69 9 -1
332 36 30 74 14 -1
332 36 30 82 8 -1
332 36 30 81 19 -1
332 36 30 86 13 -1
332 36 30 92 6 -1
332 36 30 96 16 -1
332 36 30 99 9 -1
332 36 30 109 19 -1
333 36 30 110 9 -1
333 36 30 118 17 -1
333 36 30 110 35 -1
333 36 30 121 27 -1
333 36 30 119 35 -1
333 36 30 114 44 -1
334 36 30 120 50 -1
334 36 30 105 54 -1
334 36 30 119 57 -1
334 36 30 110 65 -1
334 36 30 121 67 -1
333 36 30 108 28 -1
334 36 30 111 72 -1
334 36 30 105 86 -1
335 36 30 118 84 -1
334 36 30 118 95 -1
335 36 30 104 101 -1
335 36 30 115 106 -1
335 36 30 93 96 -1
335 36 30 93 84 -1
335 36 30 82 85 -1
335 36 30 82 77 -1
335 36 30 74 76 -1
336 36 30 87 90 -1
336 36 30 68 77 -1
336 36 30 63 72 -1
336 36 30 58 78 -1
334 36 30 120 75 -1
336 36 30 57 71 -1
337 36 30 32 50 -1
337 36 30 42 51 -1
337 36 30 38 58 -1
337 36 30 29 65 -1
337 36 30 46 66 -1
337 36 30 42 97 -1
337 36 30 37 109 -1
337 36 30 47 107 -1
337 36 30 53 93 -1
337 36 30 35 87 -1
337 36 30 32 77 -1
337 36 30 41 78 -1
337 36 30 37 67 -1
337 36 30 46 86 -1
337 36 30 23 85 -1
337 36 30 23 70 -1
275 36 30 26 76 -1 //ÄďµĐ
end
...Code://Ä®¸®¸¶6
0
//Ăß°ˇ »óÁˇ NPC
259 29 0 7 19 2
end
2
271 29 30 30 75 -1
271 29 30 35 21 -1
271 29 30 28 17 -1
271 29 30 36 11 -1
271 29 30 51 11 -1
271 29 30 42 12 -1
271 29 30 45 22 -1
271 29 30 52 24 -1
271 29 30 53 17 -1
271 29 30 60 9 -1
272 29 30 67 22 -1
271 29 30 60 22 -1
272 29 30 69 9 -1
272 29 30 74 14 -1
272 29 30 82 8 -1
272 29 30 81 19 -1
272 29 30 86 13 -1
272 29 30 92 6 -1
272 29 30 96 16 -1
272 29 30 99 9 -1
272 29 30 109 19 -1
270 29 30 110 9 -1
270 29 30 118 17 -1
270 29 30 110 35 -1
270 29 30 121 27 -1
270 29 30 119 35 -1
270 29 30 114 44 -1
268 29 30 120 50 -1
268 29 30 105 54 -1
268 29 30 119 57 -1
268 29 30 110 65 -1
268 29 30 121 67 -1
270 29 30 108 28 -1
268 29 30 111 72 -1
268 29 30 105 86 -1
273 29 30 118 84 -1
268 29 30 118 95 -1
273 29 30 104 101 -1
273 29 30 115 106 -1
273 29 30 93 96 -1
273 29 30 93 84 -1
273 29 30 82 85 -1
273 29 30 82 77 -1
273 29 30 74 76 -1
269 29 30 87 90 -1
269 29 30 68 77 -1
269 29 30 63 72 -1
269 29 30 58 78 -1
268 29 30 120 75 -1
269 29 30 57 71 -1
274 29 30 32 50 -1
274 29 30 42 51 -1
274 29 30 38 58 -1
274 29 30 29 65 -1
274 29 30 46 66 -1
274 29 30 42 97 -1
274 29 30 37 109 -1
274 29 30 47 107 -1
274 29 30 53 93 -1
274 29 30 35 87 -1
274 29 30 32 77 -1
274 29 30 41 78 -1
274 29 30 37 67 -1
274 29 30 46 86 -1
274 29 30 23 85 -1
274 29 30 23 70 -1
338 29 30 26 76 -1
end
monster.txt:
Code:271 1 "Aegis" 95 42000 0 520 550 410 0 655 230 3 17 1 7 500 1500 10 2 150 0 3 0 23 23 23 23
272 1 "Lord Centurion" 98 48500 0 540 570 432 0 680 240 3 17 2 5 500 1500 10 2 150 0 3 0 24 24 24 24
270 1 "Blood Soldier" 101 56000 0 570 600 460 0 713 255 3 17 6 7 500 1500 10 2 150 0 3 0 25 25 25 25
268 1 "Death Angel" 105 65000 0 610 645 500 0 760 275 3 17 6 7 500 1500 10 2 130 0 3 0 26 26 26 26
273 1 "Necron" 109 75500 0 672 707 550 0 820 303 3 17 2 5 500 1500 10 2 130 0 3 0 27 27 27 27
269 1 "Death Centurion" 114 87500 0 753 788 620 0 900 335 3 17 6 7 500 1500 10 2 130 0 3 0 28 28 28 28
274 1 "Schriker" 119 105000 0 850 885 710 0 1000 370 3 17 6 7 500 1600 10 2 130 0 4 0 29 29 29 29
338 1 "Illusion Kundun" 140 1400000 0 10700 11050 892 0 1200 450 3 150 10 7 800 1700 3600 2 100 0 4 0 60 60 60 60
331 1 "Aegis" 111 82000 0 712 752 584 0 850 315 3 17 1 7 500 1500 10 2 150 0 3 0 23 23 23 23
332 1 "LordCentrion" 114 88000 0 751 791 615 0 880 330 3 17 2 5 500 1500 10 2 150 0 3 0 24 24 24 24
333 1 "BloodSoldier" 117 97300 0 805 845 660 0 920 345 3 17 6 7 500 1500 10 2 150 0 3 0 25 25 25 25
334 1 "DeathAngel" 121 110000 0 870 915 720 0 960 370 3 17 6 7 500 1500 10 2 130 0 3 0 26 26 26 26
335 1 "Necron" 125 125000 0 951 996 783 0 1015 405 3 17 2 5 500 1500 10 2 130 0 3 0 27 27 27 27
336 1 "DeathCenturion" 130 145000 0 1040 1085 865 0 1080 440 3 17 6 7 500 1500 10 2 130 0 3 0 28 28 28 28
337 1 "Schriker" 135 170000 0 1168 1213 992 0 1190 485 3 17 6 7 500 1600 10 2 130 0 4 0 29 29 29 29
275 1 "Kundun" 147 5000000 0 2000 2500 1500 0 2000 1000 3 150 15 10 800 2000 3600 2 100 0 4 0 100 254 100 100
how solve this problem? (Windows 7)
13:33:47 [helflife][woody] Time synchronization poorness caused to block connection -7531
WSARecv() failed with error 10038
SwampPeace.cpp
SwampPeace.hCode://============================================================//
// Swamp Of Calmness Event Coded By M.E.S //
// //
//============================================================//
#include "StdAfx.h"
#include "SwampEvent.h"
#include "GameServer.h"
#include "Message.h"
#include "User.h"
#include "Utilidades.h"
int iSwampItemBugCount;
SwampPeace Swamp;
SwampBag g_SwampItemBag[255];
// -------------------------------------------------------------
SwampPeace::SwampPeace()
{
// ----
}
// -------------------------------------------------------------
SwampPeace::~SwampPeace()
{
// ----
}
// -------------------------------------------------------------
void SwampPeace::LoadSwampConfig()
{
Swamp.SwampEnabled = GetPrivateProfileInt("SwampOfPeace","SwampOfPeaceEventEnabled",1,EventFile);
Swamp.SwampMinutes = GetPrivateProfileInt("SwampOfPeace","SwampOfPeaceEventDuration",10,EventFile)*60;
if (Swamp.SwampEnabled == 1)
{
Swamp.LoadSwampEventItemBag();
}
}
// -------------------------------------------------------------
void SwampPeace::LoadSwampEventItemBag()
{
FILE * FilePath;
char cLineText[255] = {0};
int iIndex = 0;
int iNumber[9] = {0};
// ----
fopen_s(&FilePath,SwampEventItemBag,"r");
// ----
while(fgets (cLineText , 255 , FilePath) != NULL)
{
if(cLineText[0] != '/' && cLineText[1] != '/' && strlen(cLineText) > 3)
{
sscanf_s(cLineText , "%d %d %d %d %d %d %d %d %d", &iNumber[0], &iNumber[1], &iNumber[2],&iNumber[3], &iNumber[4], &iNumber[5], &iNumber[6], &iNumber[7], &iNumber[8]);
// ----
g_SwampItemBag[iIndex].iType = iNumber[0];
g_SwampItemBag[iIndex].iIndex = iNumber[1];
g_SwampItemBag[iIndex].iLevel = iNumber[2];
g_SwampItemBag[iIndex].iDur = iNumber[3];
g_SwampItemBag[iIndex].iLuck = iNumber[4];
g_SwampItemBag[iIndex].iSkill = iNumber[5];
g_SwampItemBag[iIndex].iOption = iNumber[6];
g_SwampItemBag[iIndex].iExc = iNumber[7];
g_SwampItemBag[iIndex].iAnc = iNumber[8];
// ----
iSwampItemBugCount++;
iIndex++;
}
}
// ---
fclose(FilePath);
}
// -------------------------------------------------------------
void SwampPeace::SwampMonsterManager(int aIndex,int MobIndex)
{
if (Swamp.SwampEnabled == 1 && Swamp.SwampIsRunning == 1)
{
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
OBJECTSTRUCT *gObjMob = (OBJECTSTRUCT*)OBJECT_POINTER(MobIndex);
// ----
if (MobIndex == Swamp.SwampBossIndex && Swamp.SwampBossKilled == 0)
{
int Random = rand()%iSwampItemBugCount;
int RewardItem = ((g_SwampItemBag[Random].iType*512)+g_SwampItemBag[Random].iIndex);
ItemSerialCreateSend(aIndex,gObjMob->MapNumber,gObjMob->X,gObjMob->Y,RewardItem,g_SwampItemBag[Random].iLevel,g_SwampItemBag[Random].iDur,g_SwampItemBag[Random].iLuck,g_SwampItemBag[Random].iSkill,g_SwampItemBag[Random].iOption,aIndex,g_SwampItemBag[Random].iExc,g_SwampItemBag[Random].iAnc);
Swamp.SwampBossKilled = 1;
}
}
}
// -------------------------------------------------------------
void SwampPeace::SwampAddMonster()
{
int RandomMapSwamp = rand()%4;
if (RandomMapSwamp == 0)
{
Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,96,167);
}
else if (RandomMapSwamp == 1)
{
Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,60,77);
}
else if (RandomMapSwamp == 2)
{
Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,140,48);
}
else if (RandomMapSwamp == 3)
{
Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,204,114);
}
else
{
Swamp.SwampBossIndex = MonsterAddAndSpawn(561,56,96,167);
}
}
// -------------------------------------------------------------
void SwampPeace::SwampOfPeaceStart()
{
if (Swamp.SwampEnabled == 1 && Swamp.SwampIsRunning == 0)
{
m_Message.AllServerGold("[Swamp of Peace] Medusa has corrupted Swamp. Find her!!");
Swamp.SwampTimer = Swamp.SwampMinutes;
Swamp.SwampIsRunning = 1;
Swamp.SwampBossKilled = 0;
Swamp.SwampAddMonster();
_beginthread(SwampOfPeaceTimer,0,NULL);
}
}
// -------------------------------------------------------------
void SwampOfPeaceTimer(void * lpParam)
{
while (true)
{
if (Swamp.SwampTimer == 0)
{
m_Message.AllServerGold("[Swamp of Peace] Medusa has taken Swamp");
gObjDel(Swamp.SwampBossIndex);
Swamp.SwampIsRunning = 0;
_endthread();
}
if (Swamp.SwampBossKilled == 1)
{
m_Message.AllServerGold("[Swamp of Peace] Medusa has been defeated. Peace has returned");
gObjDel(Swamp.SwampBossIndex);
Swamp.SwampIsRunning = 0;
_endthread();
}
Swamp.SwampTimer = Swamp.SwampTimer - 1;
Sleep(1000);
}
}
// -------------------------------------------------------------
Code://============================================================//
// Swamp Of Calmness Event Coded By M.E.S //
// //
//============================================================//
struct SwampBag
{
int iType;
int iIndex;
int iLevel;
int iDur;
int iLuck;
int iSkill;
int iOption;
int iExc;
int iAnc;
};
class SwampPeace
{
public:
SwampPeace();
~SwampPeace();
// ----
void LoadSwampConfig();
void LoadSwampEventItemBag();
void SwampMonsterManager(int aIndex,int MobIndex);
void SwampRewardItem(int aIndex);
void SwampAddMonster();
void SwampOfPeaceStart();
// ----
int SwampEnabled;
int SwampIsRunning;
int SwampMinutes;
int SwampTimer;
int SwampBossKilled;
int SwampBossIndex;
// ----
}; extern SwampPeace Swamp;
void SwampOfPeaceTimer(void * lpParam);
That is for make a Random Medusa respawn with Event Manager
But you can change Monster respawn time in Monster.txt and make event like Kundum in Kalima. For that you have to only read eventitembag and make monstermanager function.
Credits : M.E.S (Me)
This is my tokenizer
Makes easier to load bags or things like that... ;P
ps. the current code parses files like these:Code:#pragma once
#include <map>
#include <iostream>
#include <fstream>
#include <string>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp>
namespace DarKTeaM {
class TokenizerField
{
protected:
std::string Value;
public:
TokenizerField();
TokenizerField(std::string Val);
int ToInteger();
long ToLong();
double ToDouble();
float ToFloat();
std::string ToString();
char* ToStringPtr();
};
class TokenizerRow
{
public:
std::map<int, TokenizerField> Fields;
int FieldCount;
public:
TokenizerRow();
TokenizerRow(std::string strLine);
TokenizerField& operator[] (int FieldIndex);
char* GetField(int FieldIndex, char* Default);
std::string GetField(int FieldIndex, std::string Default);
float GetField(int FieldIndex, float Default);
int GetField(int FieldIndex, int Default);
long GetField(int FieldIndex, long Default);
double GetField(int FieldIndex, double Default);
bool FieldExists(int FieldIndex);
};
class TokenizerSection
{
public:
std::map<int, TokenizerRow> Rows;
int RowCount;
public:
TokenizerSection();
TokenizerRow& operator[] (int RowIndex);
bool RowExists(int RowIndex);
};
class Tokenizer
{
public:
std::map<int, TokenizerSection> Sections;
bool Loaded;
public:
Tokenizer(std::string szFile);
TokenizerSection& operator[](int SectionIndex);
bool SectionExists(int SectionIndex);
};
TokenizerField::TokenizerField() {
this->Value = "";
}
TokenizerField::TokenizerField(std::string Val) {
this->Value = Val;
}
int TokenizerField::ToInteger() {
return atoi(this->Value.c_str());
}
long TokenizerField::ToLong() {
return atol(this->Value.c_str());
}
double TokenizerField::ToDouble() {
return atof(this->Value.c_str());
}
float TokenizerField::ToFloat() {
return (float)(atof(this->Value.c_str()));
}
std::string TokenizerField::ToString() {
return this->Value;
}
char* TokenizerField::ToStringPtr() {
return (char*)this->Value.c_str();
}
TokenizerRow::TokenizerRow()
{
this->FieldCount = 0;
}
TokenizerField& TokenizerRow::operator [](int FieldIndex)
{
return this->Fields[FieldIndex];
}
char* TokenizerRow::GetField (int FieldIndex, char* Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToStringPtr();
}
std::string TokenizerRow::GetField (int FieldIndex, std::string Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToString();
}
float TokenizerRow::GetField (int FieldIndex, float Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToFloat();
}
int TokenizerRow::GetField (int FieldIndex, int Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToInteger();
}
long TokenizerRow::GetField (int FieldIndex, long Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToLong();
}
double TokenizerRow::GetField (int FieldIndex, double Default)
{
if(!this->FieldExists(FieldIndex)) return Default;
return this->Fields[FieldIndex].ToDouble();
}
TokenizerRow::TokenizerRow(std::string strLine)
{
this->FieldCount = 0;
std::string sep1 = "\\";
std::string sep2 = " \t";
std::string sep3 = "\"";
boost::escaped_list_separator<char> sep(sep1, sep2, sep3);
boost::tokenizer<boost::escaped_list_separator<char> > tok(strLine, sep);
for (boost::tokenizer<boost::escaped_list_separator<char> >::iterator it = tok.begin();
it != tok.end(); ++it)
{
if(*it == "") continue;
this->Fields[this->FieldCount++] = TokenizerField(std::string(*it));
}
}
bool TokenizerRow::FieldExists(int FieldIndex)
{
std::map<int, TokenizerField>::iterator it = this->Fields.find(FieldIndex);
return (bool)(it != this->Fields.end());
}
TokenizerSection::TokenizerSection()
{
this->Rows.clear();
this->RowCount = 0;
}
TokenizerRow& TokenizerSection::operator[] (int RowIndex)
{
return this->Rows[RowIndex];
}
bool TokenizerSection::RowExists(int RowIndex)
{
std::map<int, TokenizerRow>::iterator it = this->Rows.find(RowIndex);
return (bool)(it != this->Rows.end());
}
Tokenizer::Tokenizer(std::string szFile)
{
this->Loaded = false;
std::fstream f(szFile.c_str(), std::ios::in);
if(f.is_open() && f.good())
{
TokenizerSection sec = TokenizerSection();
int CurrentSection = 0;
int RowIndex = 0;
bool SectionOpen = false;
while(!f.eof())
{
char temp[4096];
char* dump = NULL;
std::string line = "";
ZeroMemory(&temp[0], 4096);
f.getline(&temp[0], 4095);
line.assign(&temp[0]);
dump = (char*)line.c_str();
bool finishstart = false;
bool finishend = false;
while(true)
{
if(line.length() > 0)
{
if(line.at(0) == ' ' || line.at(0) == '\t')
{
line.erase(0, 1);
}
else
{
if(finishend == true) break;
finishstart = true;
}
}
else
{
break;
}
if(line.length() > 0)
{
if(line.at(line.length()-1) == ' ' || line.at(line.length()-1) == '\t')
{
line.erase(line.length()-1, 1);
}
else
{
if(finishstart == true) break;
finishend = true;
}
}
else
{
break;
}
}
if( line.substr(0, 2) == "//" || line.substr(0, 1) == "#" || line == "" )
{
continue;
}
TokenizerRow row(line);
if(SectionOpen == false)
{
if(row.FieldCount == 2)
{
if(row[1].ToString() == "{")
{
//MessageBox(0, "Abrindo seção", "Seção", MB_OK);
CurrentSection = row[0].ToInteger();
SectionOpen = true;
RowIndex = 0;
}
}
}
else
{
if(row.FieldCount == 1)
{
if(row[0].ToString() == "}" && SectionOpen == true)
{
//MessageBox(0, "Fechando", "Seção", MB_OK);
this->Sections[CurrentSection] = sec;
sec = TokenizerSection();
SectionOpen = false;
continue;
}
}
sec[RowIndex++] = row;
sec.RowCount++;
}
}
this->Loaded = true;
}
}
TokenizerSection& Tokenizer::operator[](int SectionIndex)
{
return this->Sections[SectionIndex];
}
bool Tokenizer::SectionExists(int SectionIndex)
{
std::map<int, TokenizerSection>::iterator it = this->Sections.find(SectionIndex);
return (bool)(this->Sections.end() != it);
}
/*
Programado por WoLf
Versão antiga!
class TokenizerRow
{
public:
std::map<DWORD, std::string> Columns;
int ColumnCount;
std::string GetString(DWORD Column, std::string Default = "")
{
std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
if(it == this->Columns.end())
{
return Default;
}
return it->second;
}
char* GetStringPtr(DWORD Column, std::string Default = "")
{
std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
if(it == this->Columns.end())
{
return (char*)Default.c_str();
}
return (char*)it->second.c_str();
}
int GetInt(DWORD Column, DWORD Default = -1, BOOL Hex = FALSE)
{
std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
if(it == this->Columns.end())
{
return Default;
}
if(Hex)
{
unsigned int pOffset = Default;
sscanf_s(it->second.c_str(), "%x", &pOffset);
return pOffset;
}
return atoi(it->second.c_str());
}
double GetFloat(DWORD Column, double Default = 0.0f)
{
std::map<DWORD, std::string>::iterator it = this->Columns.find(Column);
if(it == this->Columns.end())
{
return Default;
}
return atof(it->second.c_str());
}
};
class TokenizerSection
{
public:
std::map<DWORD, TokenizerRow> Rows;
int RowCount;
};
class TokenizerGroup
{
public:
std::map<DWORD, TokenizerSection> Sections;
bool GetSection(DWORD Index, TokenizerSection & section)
{
std::map<DWORD, TokenizerSection>::iterator it = this->Sections.find(Index);
if(it == this->Sections.end())
{
return false;
}
else
{
section = it->second;
return true;
}
}
};
class Tokenizer
{
private:
char* m_pBuffer;
DWORD m_pBufferSize;
DWORD m_pBufferIndex;
public:
bool ParseLine(std::string line, TokenizerRow & pRow)
{
std::string data = "";
char* dump = (char*)line.c_str();
bool openstring = false;
bool clearingspace = true;
int column = 0;
for(unsigned int i = 0; i < line.length(); i++)
{
if(clearingspace)
{
if(dump[i] == ' ' || dump[i] == '\t')
{
continue;
}
clearingspace = false;
}
if(openstring)
{
if(dump[i] == '"')
{
openstring = false;
continue;
}
data += dump[i];
}
else
{
if(dump[i] == '"')
{
if(data != "")
{
return false;
}
openstring = true;
continue;
}
else
{
if(dump[i] == '\t' || dump[i] == ' ')
{
if(data != "")
{
pRow.Columns[column++] = data;
data = "";
}
continue;
}
data += dump[i];
}
}
}
if(data != "")
{
pRow.Columns[column++] = data;
}
data = "";
pRow.ColumnCount = column;
return true;
}
bool ParseFile(std::string file, TokenizerGroup & tok)
{
std::fstream f(file.c_str(), std::ios::in);
if(f.is_open())
{
if(f.good())
{
TokenizerSection sec = TokenizerSection();
int current_sec = 0;
int sec_index = 0;
bool sec_open = false;
while(!f.eof())
{
char temp[4096];
char* dump = NULL;
std::string line = "";
ZeroMemory(&temp[0], 4096);
f.getline(&temp[0], 4095);
line.assign(&temp[0]);
dump = (char*)line.c_str();
int start = 0;
int end = 0;
for(DWORD i = 0; i < line.length(); i++)
{
if(dump[i] != ' ' && dump[i] != '\t')
{
break;
}
start++;
}
for(DWORD i = line.length()-1; i >= 0; i--)
{
if(dump[i] != ' ' && dump[i] != '\t')
{
break;
}
end++;
}
line = line.substr(start, line.length() - end - start);
std::string::size_type k = 0;
while((k=line.find(13,k))!=line.npos)
{
line.erase(k, 1);
}
if(line.substr(0, 2) == "//") continue;
if(line[0] == '#') continue;
if(line.compare("end") == false)
{
if(sec_open == false)
{
return false; // falha de sintaxe
}
sec_open = false;
sec.RowCount = sec_index;
tok.Sections[current_sec] = sec;
continue;
}
if(line == "") continue;
TokenizerRow row;
if(!this->ParseLine(line, row))
return false;
if(row.ColumnCount == 1)
{
if(sec_open == false)
{
sec_index = 0;
current_sec = row.GetInt(0, 0);
sec = TokenizerSection();
sec_open = true;
continue;
}
}
sec.Rows[sec_index++] = row;
}
}
else
{
f.close();
return false;
}
f.close();
return true;
}
else
{
return false;
}
}
};
*/
}
and big commented section contains code for parsing webzen style files... and doesn't uses boost::tokenizer, but i don't recommend using it because of memory leaksCode:# comment line
// comment line
0 {
12345 1234.5 "string column"
}
!!comments after columns are not supported!!Code:0
12345 1234.5 "string column"
end
like:
-----------Code:0 {
col1 col2 col3 // comment
}
simple usage:
there are some functions for checking row count, column count, section count, if it exists or not, and things like that... but let intellisense help you with that :PCode:DarKTeaM::Tokenizer token ("parsethis.txt");
token[0] = access to section 0
token[0][0] = access to section 0, and row 0
token[0][0][0] = access to section 0, row 0, and column 0
token[0][0][0].Function() = where function is your requested type... line ToInteger(), ToString(), etc...
if you can't compile it, its not my fault...
btw, you'll need boost lib installed... :rolleyes:
wolfulus, hades project is dead or not?
someone know item to register Luckycoin Event
My item.bmd and txt, i thing don't have it
group: 14
id: 100
it isn't... I'm currently reworking my antihack system (some servers requested me to), and a project for university are taking my time to... I'll start working on it again when I finish the antihack and the university project.
I'll post the network engine source code this week maybe, or next one.
Ps. I haven't posted any news, since no one cares about it, I dont care too :P
[]'s
wolfulus, Why do you think that no one cares? I think many people watching your project. silently :)
where i can read about your antihack system? it's private?
slyfox125, use this proxies (JP). .
can you make me a main.exe with ip 192.168.2.100 im not good im hex please help me
this it my first post...
for those who have trouble compiling of ACGSeason5Premium Sources, i read in x-mu.net (Russia forum) that we have to do the next:
* In the project:
Delete:*In Header Files > StdAfx.hCode:Security.h and Security.cpp
Delete:*In Header Files > User.hCode:#include "security.h"
Add a line with:*In Header Files > Utils.hCode:#define MAX_PLAYERID 9000
Add a line with:*In Source Files > GameServer.cppCode:#include "User.h"
Delete:
With that we have not more problems :8::thumbup::8:Code:// Cheking Mac Protections
if(Check(1)) {
Checking = 1;
}
if(!Check(0)) {
Checking = 0;
}
sorry for my bad English, this is because I'm from Argentina and speak Spanish not English really: P