OYUN SEÇENEKLERİNE EKLEMEK İSTEYEN İÇİN Anlatım:
uigameoptions.py
Açılır ve aratılır:
Kod:
self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
Altına eklenir:
Burdan alın
Aratılır:
Kod:
self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)
Altına Eklenir:
Burdan alın
En sona eklenir:
Burdan alın
Aratılır:
Kod:
self.showsalesTextButtonList = []
Altına eklenir:
Kod:
self.ChangeChannelButtonList = []
constInfo.py
açılır ve herhangi bir yere eklenir:
Kod:
change_time = 0
uiscript/gameoptiondialog.py
Açılır ve aratılır:
Kod:
TEMPORARY_X = +13
Değiştirilir:
Kod:
TEMPORARY_X = +14
Aratılır:
Kod:
{
"name" : "titlebar",
"type" : "titlebar",
"style" : ("attach",),
"x" : 8,
"y" : 8,
"width" : 284,
"color" : "gray",
"children" :
(
{ "name":"titlename", "type":"text", "x":0, "y":3,
"text" : uiScriptLocale.GAMEOPTION_TITLE,
"horizontal_align":"center", "text_horizontal_align":"center" },
),
},
Altına Eklenir:
Burdan alın
Aratılır 2 kere:
Kod:
"height" : 25*11+8,
Değiştirilir 2 kere:
Kod:
"height" : 25*11+8+25,
Server/game/src/cmd.cpp
Açılır ve aratılır:
Kod:
ACMD(do_item);
Altına Eklenir:
Kod:
ACMD(do_ch);
Aratılır:
Kod:
{ "pvp", do_pvp, 0, POS_DEAD, GM_PLAYER },
Altına Eklenir:
Kod:
{ "ch", do_ch, 0, POS_DEAD, GM_PLAYER },
cmd_general.cpp açılır
Aratılır:
Kod:
ACMD(do_set_walk_mode)
{
ch->SetNowWalking(true);
ch->SetWalking(true);
}
Altına Eklenir:
Kod:
ACMD(do_ch)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));
if (!*arg1)
return;
int new_ch;
str_to_number(new_ch, arg1);
if( new_ch <1 || new_ch >4)
return;
if (!ch->IsPC())
return;
ch->ChannelSwitch(new_ch);
}
char.h
Açılır ve Aratılır:
Kod:
void StartWarpNPCEvent();
Altına Eklenir:
Kod:
void ChannelSwitch(int new_ch);
char.cpp
Açılır ve aratılır:
Kod:
EVENTFUNC(warp_npc_event)
{
char_event_info* info = dynamic_cast<char_event_info*>( event->info );
if ( info == NULL )
{
sys_err( "warp_npc_event> <Factor> Null pointer" );
return 0;
}
LPCHARACTER ch = info->ch;
if (ch == NULL) { // <Factor>
return 0;
}
if (!ch->GetSectree())
{
ch->m_pkWarpNPCEvent = NULL;
return 0;
}
FuncCheckWarp f(ch);
if (f.Valid())
ch->GetSectree()->ForEachAround(f);
return passes_per_sec / 2;
}
Altına Eklenir:
Kod:
void CHARACTER::ChannelSwitch(int iNewChannel)
{
long lAddr;
long lMapIndex;
WORD wPort;
long x = this->GetX();
long y = this->GetY();
if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
{
return;
}
if(lMapIndex >= 10000){
return;
}
std::map<WORD, int>ch;
for(int i = 0; i < 4; i++)
{
for(int i2 = 1; i2 < 9; i2++)
{
ch[29*1000 + i*100 + i2] = i+1;
}
}
int chan;
if(ch.find(wPort) != ch.end())
{
chan = ch[wPort];
}
else
{
return;
}
Stop();
Save();
if(GetSectree())
{
GetSectree()->RemoveEntity(this);
ViewCleanup();
EncodeRemovePacket(this);
}
TPacketGCWarp p;
p.bHeader = HEADER_GC_WARP;
p.lX = x;
p.lY = y;
p.lAddr = lAddr;
p.wPort = (wPort - 100*(chan-1) + 100*(iNewChannel-1));
GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}
ÖRNEK PORT DAĞILIMI:
Kod:
CH1:
Core1: 29001
Core2: 29002
Core3: 29003
Core4: 29004
CH2:
Core1: 29101
Core2: 29102
Core3: 29103
Core4: 29104
CH3:
Core1: 29201
Core2: 29202
Core3: 29203
Core4: 29204
4 ü ch sayınıza göre değiştiriniz ...
uigameoptions.py
Açılır ve aratılır:
Kod:
self.showsalesTextButtonList.append(GetObject("salestext_off_button"))
Altına eklenir:
Burdan alın
Aratılır:
Kod:
self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)
Altına Eklenir:
Burdan alın
En sona eklenir:
Burdan alın
Aratılır:
Kod:
self.showsalesTextButtonList = []
Altına eklenir:
Kod:
self.ChangeChannelButtonList = []
constInfo.py
açılır ve herhangi bir yere eklenir:
Kod:
change_time = 0
uiscript/gameoptiondialog.py
Açılır ve aratılır:
Kod:
TEMPORARY_X = +13
Değiştirilir:
Kod:
TEMPORARY_X = +14
Aratılır:
Kod:
{
"name" : "titlebar",
"type" : "titlebar",
"style" : ("attach",),
"x" : 8,
"y" : 8,
"width" : 284,
"color" : "gray",
"children" :
(
{ "name":"titlename", "type":"text", "x":0, "y":3,
"text" : uiScriptLocale.GAMEOPTION_TITLE,
"horizontal_align":"center", "text_horizontal_align":"center" },
),
},
Altına Eklenir:
Burdan alın
Aratılır 2 kere:
Kod:
"height" : 25*11+8,
Değiştirilir 2 kere:
Kod:
"height" : 25*11+8+25,
Server/game/src/cmd.cpp
Açılır ve aratılır:
Kod:
ACMD(do_item);
Altına Eklenir:
Kod:
ACMD(do_ch);
Aratılır:
Kod:
{ "pvp", do_pvp, 0, POS_DEAD, GM_PLAYER },
Altına Eklenir:
Kod:
{ "ch", do_ch, 0, POS_DEAD, GM_PLAYER },
cmd_general.cpp açılır
Aratılır:
Kod:
ACMD(do_set_walk_mode)
{
ch->SetNowWalking(true);
ch->SetWalking(true);
}
Altına Eklenir:
Kod:
ACMD(do_ch)
{
char arg1[256];
one_argument(argument, arg1, sizeof(arg1));
if (!*arg1)
return;
int new_ch;
str_to_number(new_ch, arg1);
if( new_ch <1 || new_ch >4)
return;
if (!ch->IsPC())
return;
ch->ChannelSwitch(new_ch);
}
char.h
Açılır ve Aratılır:
Kod:
void StartWarpNPCEvent();
Altına Eklenir:
Kod:
void ChannelSwitch(int new_ch);
char.cpp
Açılır ve aratılır:
Kod:
EVENTFUNC(warp_npc_event)
{
char_event_info* info = dynamic_cast<char_event_info*>( event->info );
if ( info == NULL )
{
sys_err( "warp_npc_event> <Factor> Null pointer" );
return 0;
}
LPCHARACTER ch = info->ch;
if (ch == NULL) { // <Factor>
return 0;
}
if (!ch->GetSectree())
{
ch->m_pkWarpNPCEvent = NULL;
return 0;
}
FuncCheckWarp f(ch);
if (f.Valid())
ch->GetSectree()->ForEachAround(f);
return passes_per_sec / 2;
}
Altına Eklenir:
Kod:
void CHARACTER::ChannelSwitch(int iNewChannel)
{
long lAddr;
long lMapIndex;
WORD wPort;
long x = this->GetX();
long y = this->GetY();
if (!CMapLocation::instance().Get(x, y, lMapIndex, lAddr, wPort))
{
return;
}
if(lMapIndex >= 10000){
return;
}
std::map<WORD, int>ch;
for(int i = 0; i < 4; i++)
{
for(int i2 = 1; i2 < 9; i2++)
{
ch[29*1000 + i*100 + i2] = i+1;
}
}
int chan;
if(ch.find(wPort) != ch.end())
{
chan = ch[wPort];
}
else
{
return;
}
Stop();
Save();
if(GetSectree())
{
GetSectree()->RemoveEntity(this);
ViewCleanup();
EncodeRemovePacket(this);
}
TPacketGCWarp p;
p.bHeader = HEADER_GC_WARP;
p.lX = x;
p.lY = y;
p.lAddr = lAddr;
p.wPort = (wPort - 100*(chan-1) + 100*(iNewChannel-1));
GetDesc()->Packet(&p, sizeof(TPacketGCWarp));
}
ÖRNEK PORT DAĞILIMI:
Kod:
CH1:
Core1: 29001
Core2: 29002
Core3: 29003
Core4: 29004
CH2:
Core1: 29101
Core2: 29102
Core3: 29103
Core4: 29104
CH3:
Core1: 29201
Core2: 29202
Core3: 29203
Core4: 29204
for(int i = 0; i < 4; i++)
4 ü ch sayınıza göre değiştiriniz ...