Re: GSExpansion [ 1.00.90/INDB/CScript ]
i see nobody cares of the development...
Edit:
As i am open source supporter here are INDB source (Still need a lot of work!)
INDB.cpp
PHP Code:
#include "StdAfx.h"
#include <string>
#include <Process.h>
#include "INDB.h"
indb_class INDB;
int indb_class::RetrieveInteger(char* Where, char* What,int Default, char* File)
{
return GetPrivateProfileInt(Where,What,Default,File);
}
char* indb_class::RetrieveString(char* Where, char* What, char* File)
{
char* String;
GetPrivateProfileString(Where,What,0,String,sizeof(String),File);
return String;
}
void indb_class::Write(char* Where, char* What, char* Value, char* File)
{
WritePrivateProfileString(Where,What,Value,File);
}
void indb_class::DeleteSection(char* Where, char* File)
{
WritePrivateProfileString(Where,NULL,"0",File);
}
bool indb_class::FileExist(char* File)
{
WIN32_FIND_DATAA wfd;
if (FindFirstFileA(File,&wfd)==INVALID_HANDLE_VALUE)
{
return false;
}
return true;
}
void indb_class::ReplaceChar(char *String, char Old, char New)
{
while (*String != 0)
{
if (*String == Old)
{
*String = New;
String++;
}
}
}
void indb_class::Init()
{
if(this->FileExist("./database/Character.txt") == false)
{
Console.Write("[INDB] Character.txt database can't be found, please check is it exist!");
Sleep(1000*30);
ExitProcess(0);
}
HookThis((DWORD)&UserExit,0x004034B8);
if(INDB_DEBUG_LOG == true)
Console.Write("[INDB DEBUG] INDB.Init() has been loaded in memory!");
}
void UserExit (int aIndex)
{
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
for(int i = OBJECT_MIN; i < OBJECT_MAX; i++)
{
OBJECTSTRUCT *Obj = (OBJECTSTRUCT*)OBJECT_POINTER(i);
if(Obj->Name == gObj->Name)
{
for (int j=i;j<INDB.ObjSize-1;j++)
{
INDB.Structure[j].CanUsePost = INDB.Structure[j+1].CanUsePost;
INDB.Structure[j].UserCharacterBanned = INDB.Structure[j+1].UserCharacterBanned;
INDB.Structure[j].UserMuted = INDB.Structure[j+1].UserMuted;
INDB.Structure[j].CanUsePost = INDB.Structure[j+1].CanUsePost;
INDB.Structure[j].IsPersonalMessage = INDB.Structure[j+1].IsPersonalMessage;
INDB.Structure[j].PMText = INDB.Structure[j+1].PMText;
INDB.Structure[j].PermanentMoney = INDB.Structure[j+1].PermanentMoney;
INDB.Structure[j].PermMoneyAmount = INDB.Structure[j+1].PermMoneyAmount;
}
INDB.ObjSize--;
break;
}
}
}
void LoadUserProcess(void * lpParam)
{
while(true)
{
INDB.LoadUser(INDB._aIndex);
_endthread();
}
}
void indb_class::LoadUser(int aIndex){
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
this->Structure[gObj->m_Index].UserCharacterBanned = this->RetrieveInteger(gObj->Name,"UserCharacterBanned",0,"./database/Character.txt");
this->Structure[gObj->m_Index].UserMuted = this->RetrieveInteger(gObj->Name,"UserMuted",0,"./database/Character.txt");
this->Structure[gObj->m_Index].CanUsePost = this->RetrieveInteger(gObj->Name,"CanUsePost",1,"./database/Character.txt");
this->Structure[gObj->m_Index].IsPersonalMessage = this->RetrieveInteger(gObj->Name,"IsPersonalMessage",0,"./database/Character.txt");
this->Structure[gObj->m_Index].PMText = this->RetrieveString(gObj->Name,"IsPersonalMessage","./database/Character.txt");
this->Structure[gObj->m_Index].PermanentMoney = this->RetrieveInteger(gObj->Name,"PermanentMoney",0,"./database/Character.txt");
this->Structure[gObj->m_Index].PermMoneyAmount = this->RetrieveInteger(gObj->Name,"PermMoneyAmount",0,"./database/Character.txt");
ObjSize+1;
if(INDB_DEBUG_LOG == true)
Console.Write("[INDB DEBUG] INDB.LoadUser() %s structure has been loaded!",gObj->Name);
}
void indb_class::ManageUser(int aIndex,FunctionList Function,LPBYTE aRecv)
{
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
switch (Function)
{
case CHECK_IF_CHAR_BANNED:
if(this->Structure[gObj->m_Index].UserCharacterBanned == 1)
{
CloseClient(aIndex);
if(INDB_DEBUG_LOG == true)
Console.Write("[INDB DEBUG] %s is unavalible to connect, status banned!",gObj->Name);
}
break;
case IS_PERSONAL_MESSAGE:
if(this->Structure[gObj->m_Index].IsPersonalMessage == 1)
{
GCServerMsgStringSend(this->Structure[gObj->m_Index].PMText,aIndex,0);
}
else
{
GCServerMsgStringSend(gConnectMassage,aIndex,0);
}
case IS_PERMANENT_MONEY:
if(this->Structure[gObj->m_Index].PermanentMoney == 1)
{
gObj->Money = this->Structure[gObj->m_Index].PermMoneyAmount;
}
break;
case CHAT_CORE:
if(!memcmp(&aRecv[13],"/csc db",strlen("/csc db")))
{
char *Name,*Option,*Value,*File,*FullFile;
sscanf((char*)aRecv+13+strlen("/csc db"),"%s %s %s %s",&Name,&Option,&Value,&File);
sprintf(FullFile,"./database/%s.txt",File);
if(!(gObj->Authority == 34) || !(gObj->Authority == 32) || !(gObj->Authority == 8))
return;
if(this->FileExist(FullFile) == false)
{
GCServerMsgStringSend("[INDB] Database cannot be found!",aIndex,0);
return;
}
for(int i = OBJECT_MIN; i < OBJECT_MAX; i++)
{
OBJECTSTRUCT *Obj = (OBJECTSTRUCT*)OBJECT_POINTER(i);
if(Obj->Name == Name)
{
this->ReplaceChar(Option,(char)"_",(char)" ");
this->Write(Name,Option,Value,FullFile);
return;
}
else
{
GCServerMsgStringSend("[INDB] Character cannot be found!",aIndex,0);
return;
}
}
}
else if(!memcmp(&aRecv[13],"/csc db load",strlen("/csc db load")))
{
char* Name;
sscanf((char*)aRecv+13+strlen("/csc db load"),"%s",&Name);
if(!(gObj->Authority == 34) || !(gObj->Authority == 32) || !(gObj->Authority == 8))
return;
for(int i = OBJECT_MIN; i < OBJECT_MAX; i++)
{
OBJECTSTRUCT *Obj = (OBJECTSTRUCT*)OBJECT_POINTER(i);
if(gObj->Name == Name || gObj->Connected == PLAYER_PLAYING)
{
this->LoadUser(Obj->m_Index);
}
}
GCServerMsgStringSend("[INDB] User structure reloaded!",aIndex,1);
Console.Write("[INDB DEBUG] %s structure reloaded!",gObj->Name);
}
break;
}
}
extern indb_class INDB;
INDB.h
PHP Code:
#define INDB_DEBUG_LOG true
enum FunctionList
{
CHECK_IF_CHAR_BANNED = 0,
IS_PERSONAL_MESSAGE = 1,
CHAT_CORE = 2,
IS_PERMANENT_MONEY = 3,
};
void UserExit (int aIndex);
void LoadUserProcess(void * lpParam);
class indb_class{
public:
int RetrieveInteger (char* Where, char* What,int Default, char* File);
char* RetrieveString (char* Where, char* What, char* File);
void Write (char* Where, char* What, char* Value, char* File);
void DeleteSection (char* Where, char* File);
bool FileExist (char* File);
void Init ();
void LoadUser (int aIndex);
void ManageUser (int aIndex,FunctionList Function,LPBYTE aRecv);
void ReplaceChar (char *String, char Old, char New);
private:
struct indb_struct_s{
int UserCharacterBanned;
int UserMuted;
int CanUsePost;
int IsPersonalMessage;
char* PMText;
int PermanentMoney;
DWORD PermMoneyAmount;
};
public:
int ObjSize;
int _aIndex;
public:
indb_struct_s Structure[OBJECT_MAXUSER];
};
extern indb_class INDB;
Re: GSExpansion [ 1.00.90/INDB/CScript ]
yep because any script lang in GS its very hard because you need write with mega optimization. If you don't do this then you GS eat 80-100% with normal online. (sorry dude but this sources havent any optimization).
And peoples only need bug free server.
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
Kirgston
yep because any script lang in GS its very hard because you need write with mega optimization. If you don't do this then you GS eat 80-100% with normal online. (sorry dude but this sources havent any optimization).
And peoples only need bug free server.
as you see that source have some optimization like,
- when user exits from server their structures has removed from gameserver memory
- user structures are loaded from seperate tread..
and still this is too basic to make server very laggy..
Re: GSExpansion [ 1.00.90/INDB/CScript ]
If this is finished and made stable, I think is a good base for the newb game masters to start "programming" their own server.
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Bryan_Furry , you got 10 posts.. u seem not be trustworthy so i suggest you continue this project and keep updating it then you will gain "likers" :)
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
Denied
Bryan_Furry , you got 10 posts.. u seem not be trustworthy so i suggest you continue this project and keep updating it then you will gain "likers" :)
Project isn't stoped... im working for it much as possible...
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Posted changelog / updates
Edit: Im looking for PHP coder to finish my live statistics system, if anyone want to join please PM me!
Re: GSExpansion [ 1.00.90/INDB/CScript ]
It's not about caring, it's all about trust and you totally s**k at this
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
Denied
It's not about caring, it's all about trust and you totally s**k at this
Update: Im making npc based quest system... it will be nice addon for this game! more info soon
About Quest System
Quote:
This quest system is npc based, there are many types for reward but currently supports only two, item and zen rewards. Other types will be, buff and skill reward. When quests is finished you must go to same npc where you started and it will give you your reward and location of next quest, one npc can support many different quests for different levels, races and classes!
Notes
Quote:
In configuration files all for quest name and objectives you must use synbol "_" as space, gameserver will automaticly parse "_" and replace with " " (space)
Configuration example
PHP Code:
//===========================================================
//XRM Team :: Mu Server - 1.00a / GameServer 1.00.90
//===========================================================
// 1 - Quest Name
// 2 - Quest Objectives
// 3 - Quest NPC ID
// 4 - Quest NPC Map
// 5 - Quest NPC X
// 6 - Quest NPC Y
// 7 - Quest Min Level
// 8 - Quest Max Level
// 9 - Quest Need Item
// 10 - Quest Need Item Count
// 11 - Quest Need Item Group
// 12 - Quest Need Item Group ID
// 13 - Quest Need Monster
// 14 - Quest Need Monster ID
// 15 - Quest Need Monster Count
// 16 - Quest Is Zen Reward
// 17 - Quest Is Item Reward
// 18 - Quest Zen Reward Count
// 19 - Quest Item Reward Type
// 20 - Quest Item Reward Index
// 21 - Quest Item Reward Level
// 22 - Quest Item Reward Skill
// 23 - Quest Item Reward Luck
// 24 - Quest Item Reward Option
// 25 - Quest Item Reward Excellent
// 26 - Quest For All Classes
// 27 - Quest Only for Dark Knigt
// 28 - Quest Only for Blade Knigt
// 29 - Quest Only for Blade Master
// 30 - Quest Only for Dark Wizard
// 31 - Quest Only for Soul Master
// 32 - Quest Only for Grand Master
// 33 - Quest Only for Elf
// 34 - Quest Only for Muse Elf
// 35 - Quest Only for Higth Elf
// 36 - Quest Only for Magic Gladiator
// 37 - Quest Only for Duel Master
// 38 - Quest Only for Grand Master
// 39 - Quest Only for Dark Lord
// 40 - Quest Only for Lord Emperor
// 41 - Quest Only for Summoner
// 42 - Quest Only for Bloody Summoner
// 43 - Quest Only for Dimension Master
//===============================================================================================================================================================================================================
// [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]
//===============================================================================================================================================================================================================
The_Path_Of_Knowlege Kill_10_Spiders_and_find_one_Devils_Aye_and_bring_it_to_me!_You_will_be_rewarded_with_1000_zen! 247 0 125 125 0 400 1 1 13 25 1 2 10 1 1 90000 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Edit: Quest system progress is about 60%, if ill countinue at this speed it will be ready today :)
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
|ARIES|
Good Dev! keep working!
Posted my old quest system source!
Re: GSExpansion [ 1.00.90/INDB/CScript ]
You have many projects, but none of them is finished.
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
ma-3x
You have many projects, but none of them is finished.
So, what i need to do now? kill my self? :thumbup:
Re: GSExpansion [ 1.00.90/INDB/CScript ]
No =) Can you tell what OpenGL effect do you use in your Main?
Re: GSExpansion [ 1.00.90/INDB/CScript ]
Quote:
Originally Posted by
ma-3x
No =) Can you tell what OpenGL effect do you use in your Main?
i use doom open source addon to edit blur and glow effect