📄 gameclient.cpp
字号:
// GameClient.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
GSG_SelectPlayer* g_ptr_select_player_game = NULL;
MainGame* g_ptr_main_game = NULL;
CConfig g_config;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
GameClientApp app;
GameClientEngine engine;
CGsSource source;
std::string str;
GSG_SelectPlayer game_select_player(&engine);
g_ptr_select_player_game = &game_select_player;
MainGame main_game(&engine);
g_ptr_main_game = &main_game;
LOG log;
log.BeginLog("log.txt");
// g_ptr_net_lib_log = &log;
int ret = 0;
if (!Net_Startup(2,2))
{
return 0;
}
source.Load("test.gss");
if(FALSE==app.CreateApp(hInstance, lpCmdLine, IDI_DEMO, false, 800, 600))
goto exit;
engine.InitEngine(app.GetMainWnd());
engine.SetSource(&source);
engine.SetGame(&game_select_player);
str = CGsFunc::GetGsApp()->GetAppPath(NULL);
str += "\\server.ini";
g_config.SetINIFile(str.c_str());
main_game.LoadConfig();
if(FALSE==game_select_player.InitGame())
{
goto exit;
}
ret = app.Run();
main_game.EndGame();
exit:
main_game.Disconnect();
Net_Cleanup();
return ret;
}
std::string g_get_unit_res(int type)
{
std::string str_res;
switch(type)
{
case 1:
str_res = "npc\\behemoth.ini";
break;
case 2:
str_res = "npc\\arch_angel.ini";//"npc\\chaos_magic_female.ini";
break;
case 3:
str_res = "npc\\evil_sorceress.ini";//"npc\\life_magic_female.ini";
break;
case 4:
str_res = "npc\\bandit.ini";//"npc\\chaos_archer_male.ini";
break;
case 5:
str_res = "npc\\black_dragon.ini";
break;
case 6:
str_res = "npc\\titan.ini";
break;
case 7:
str_res = "npc\\wolf.ini";//"npc\\dark_blademaster.ini";
break;
case 8:
str_res = "npc\\gargantuan.ini";
break;
case 9:
str_res = "npc\\berserker.ini";
break;
case 10:
str_res = "npc\\dwarf.ini";
break;
case 11:
str_res = "npc\\imp.ini";
break;
case 12:
str_res = "npc\\dark_blademaster.ini";
break;
case 13:
str_res = "npc\\dark_knight.ini";
break;
case 14:
str_res = "npc\\beholder.ini";
break;
case 15:
str_res = "npc\\champion.ini";
break;
case 16:
str_res = "npc\\crusader.ini";
break;
case 17:
str_res = "npc\\mermaid.ini";
break;
case 18:
str_res = "npc\\minotaur.ini";
break;
case 19:
str_res = "npc\\naga.ini";
break;
case 20:
str_res = "npc\\orge_mage.ini";
break;
case 21:
str_res = "npc\\skeleton.ini";
break;
case 22:
str_res = "npc\\sprite.ini";
break;
case 23:
str_res = "npc\\thunderbird.ini";
break;
case 24:
str_res = "npc\\Troglodyte.ini";
break;
case 25:
str_res = "npc\\troll.ini";
break;
case 26:
str_res = "npc\\unicorn.ini";
break;
case 27:
str_res = "npc\\vampire.ini";
break;
case 28:
str_res = "npc\\white_tiger.ini";
break;
case 29:
str_res = "npc\\beholder.ini";
break;
case 30:
str_res = "npc\\life_magic_female.ini";
break;
case 31:
str_res = "npc\\magic_girl.ini";
break;
case 32:
str_res = "npc\\power_man.ini";
break;
case 33:
str_res = "npc\\power_man.ini";
break;
case 34:
str_res = "npc\\death_archer_female.ini";
break;
case 35:
str_res = "npc\\death_magic_female.ini";
break;
case 36:
str_res = "npc\\order_archer_female.ini";
break;
case 37:
str_res = "npc\\order_might_female.ini";
break;
case 38:
str_res = "npc\\efreet.ini";
break;
case 39:
str_res = "npc\\genie.ini";
break;
case 40:
str_res = "npc\\chaos_magic_female.ini";
break;
case 41:
str_res = "npc\\ghost.ini";
break;
case 42:
str_res = "npc\\swordman.ini";
break;
case 43:
str_res = "npc\\beholder.ini";
break;
default:
str_res = "npc\\behemoth.ini";
break;
}
return str_res;
}
std::string g_get_particle_magic_res(int type)
{
std::string str_res;
if(type>=150 && type<1000)
{
str_res = "particles\\magic_arrow";
return str_res;
}
switch(type)
{
case 2001:
case 2051:
str_res = "particles\\magic_1";
break;
case 2002:
case 2052:
str_res = "particles\\magic_2";
break;
case 2003:
case 2053:
str_res = "game\\test_1";
break;
case 2004:
case 2054:
str_res = "particles\\magic_3";
break;
case 2005:
case 2055:
str_res = "particles\\magic_5";
break;
case 2006:
case 2056:
str_res = "particles\\magic_6";
break;
default:
str_res = "";
break;
}
return str_res;
}
std::string g_get_effect_ani_res(int type)
{
std::string str_res;
switch(type)
{
case 101:
case 151:
case 1001:
case 1011:
case 1051:
case 2001:
case 2051:
str_res = "animation\\spell\\lighting.txg";//闪电
break;
case 102:
case 152:
case 1002:
case 1052:
case 2002:
case 2052:
str_res = "magic\\poison.txg";//毒
break;
case 103:
case 153:
case 1003:
case 1053:
case 2003:
case 2053:
str_res = "magic\\stun.txg";//吸魂魄
break;
case 104:
case 154:
case 1004:
case 1054:
case 2004:
case 2054:
str_res = "magic\\terror.txg";//冰冻
break;
case 105:
case 155:
case 1005:
case 1055:
case 2005:
case 2055:
str_res = "magic\\cancellation.txg";//吸魂魄
break;
case 106:
case 156:
case 1006:
case 1056:
case 2006:
case 2056:
str_res = "magic\\fear.txg";//吸魂魄
break;
default:
str_res = "magic\\stun.txg";//晕
break;
}
return str_res;
}
std::string g_get_missile_ani_res(int type)
{
std::string str_res;
if(type<1000)
{
str_res = "ani\\arrow.txg";
return str_res;
}
switch(type)
{
case 1001:
case 1011:
case 1051:
case 2001:
case 2051:
// str_res = "animation\\spell\\lighting.txg";//闪电
// break;
case 1002:
case 1052:
case 2002:
case 2052:
// str_res = "magic\\poison.txg";//毒
// break;
case 1003:
case 1053:
case 2003:
case 2053:
// str_res = "magic\\stun.txg";//吸魂魄
// break;
case 1004:
case 1054:
case 2004:
case 2054:
// str_res = "magic\\terror.txg";//冰冻
// break;
case 1005:
case 1055:
case 2005:
case 2055:
// str_res = "magic\\cancellation.txg";//吸魂魄
// break;
case 1006:
case 1056:
case 2006:
case 2056:
// str_res = "magic\\fear.txg";//吸魂魄
// break;
default:
str_res = "";//
break;
}
return str_res;
}
std::string g_get_effect_sound_res(int type)
{
std::string str_res;
switch(type)
{
case 101:
case 151:
case 1001:
case 1011:
case 1051:
case 2001:
case 2051:
str_res = "sound\\LightningBolt.wav";//闪电
break;
case 102:
case 152:
case 1002:
case 1052:
case 2002:
case 2052:
str_res = "sound\\die_3.wav";//毒
break;
case 103:
case 153:
case 1003:
case 1053:
case 2003:
case 2053:
str_res = "sound\\fireball.wav";//
break;
case 104:
case 154:
case 1004:
case 1054:
case 2004:
case 2054:
str_res = "sound\\hurt_2.wav";//冰冻
break;
case 105:
case 155:
case 1005:
case 1055:
case 2005:
case 2055:
str_res = "sound\\hurt_4.wav";//吸魂魄
break;
case 106:
case 156:
case 1006:
case 1056:
case 2006:
case 2056:
str_res = "sound\\hurt_4.wav";//吸魂魄
break;
default:
str_res = "";//晕
break;
}
return str_res;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -