stoneage8.5/石器时代8.5客户端最新源代码/石器源码/system/CharSignDay.cpp

184 lines
4.9 KiB
C++
Raw Normal View History

2020-06-23 15:27:59 +08:00
#include "../systeminc/version.h"
#include "../systeminc/system.h"
#include "../systeminc/CharSignDay.h"
#include "../newproto/autil.h"
#include "../systeminc/menu.h"
#include "../systeminc/shop.h"
#include "../systeminc/t_music.h"
#include "../newproto/protocol.h"
#include "../other/caryIme.h"
#include "../systeminc/field.h"
#include "../systeminc/netmain.h"
#ifdef _CHARSIGNDAY_
extern unsigned int sockfd;
extern int nowGx, nowGy;
extern int indexWN;
extern int idWN;
extern short wnCloseFlag;
extern int cloasewindows;
extern int windowTypeWN;
ACTION * ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ=0;
int ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y;
extern char <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[1024];
int ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
typedef struct {
int ID;
char <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[64];
char <EFBFBD><EFBFBD><EFBFBD><EFBFBD>[512];
}ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽;
typedef struct {
int <EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>;
int ״̬;
int <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
int <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>[30];
}ǩ<EFBFBD><EFBFBD><EFBFBD>;
ǩ<EFBFBD><EFBFBD><EFBFBD> ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
short ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[][2]={
{0,3},
{1,6},
{2,8},
{3,11},
{4,13},
{5,16}
};
int ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD>=588;
int ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>=396;
void ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڳ<EFBFBD>ʼ<EFBFBD><EFBFBD>(char * <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
{
memset(&ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,sizeof(ǩ<EFBFBD><EFBFBD><EFBFBD>));
memset(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,1024);
if(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ) DeathAction(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ=0;
char *<EFBFBD><EFBFBD>ʱ=new char [512];
char *<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=new char [512];
memset(<EFBFBD><EFBFBD>ʱ,0,512);
memset(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,512);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,(char *)"|",1,<EFBFBD><EFBFBD>ʱ,10);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD>߿<EFBFBD>=atoi(<EFBFBD><EFBFBD>ʱ);
memset(<EFBFBD><EFBFBD>ʱ,0,10);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,(char *)"|",2,<EFBFBD><EFBFBD>ʱ,10);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=atoi(<EFBFBD><EFBFBD>ʱ);
memset(<EFBFBD><EFBFBD>ʱ,0,10);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,(char *)"|",3,<EFBFBD><EFBFBD>ʱ,10);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=atoi(<EFBFBD><EFBFBD>ʱ);
memset(<EFBFBD><EFBFBD>ʱ,0,10);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,(char *)"|",4,<EFBFBD><EFBFBD>ʱ,30);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.״̬=atoi(<EFBFBD><EFBFBD>ʱ);
memset(<EFBFBD><EFBFBD>ʱ,0,512);
memset(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,512);
int i;
for(i=0;i<ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;i++){
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>,(char *)"#@",2+i,<EFBFBD><EFBFBD>ʱ,512);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD>ʱ,(char *)"|",1,<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,10);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD>[i].ID=atoi(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>);
memset(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,10);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD>ʱ,(char *)"|",2,<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,64);
sprintf(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD>[i].<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,"%s",<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>);
memset(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,64);
getStringFromIndexWithDelim_body((char *) <EFBFBD><EFBFBD>ʱ,(char *)"|",3,<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,512);
sprintf(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD>[i].<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,"%s",<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>);
memset(<EFBFBD><EFBFBD>ʱ,0,512);
memset(<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,512);
}
delete <EFBFBD><EFBFBD>ʱ;
delete <EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=0;
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X=(800-ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD>)/2+ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD>/2;
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y=(600-ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>)/2-40+ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD>/2;
}
ACTION* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>()
{
if(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ) DeathAction(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ = MakeWindowDisp(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y,0,0,55217,0,FALSE);
play_se(202,320,240);
return ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ;
}
void <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>()
{
if(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ) DeathAction(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ);
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ=0;
wnCloseFlag=0;
windowTypeWN = -1;
wnCloseFlag = 1;
}
ACTION* ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ()
{
int <EFBFBD><EFBFBD><EFBFBD><EFBFBD>X=55;
int <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y=58;
int <EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=0;
int i,b;
for(i=0;i<5;++i){
for(b=0;b<6;++b){
<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>++;
StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X-225+b*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>X,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-65+i*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y,106,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EF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BD>[<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1].<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>);
}
if((ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.״̬&(1<<<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)))
// StockDispBuffer(400, 288, DISP_PRIO_MENU-1, 55256, 0);
StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X-225+b*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>X,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-65+i*<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y,107,55269,1);//ǩ<><C7A9><EFBFBD>ɹ<EFBFBD>
if(<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> >= ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) break;
}
}
//<2F><>ͼ
StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y+28,104,55217,1);
//ǩ<><C7A9>
int <EFBFBD><EFBFBD>ťID = StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X+200,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y+207,105,55216,2);
if( mouse.onceState & MOUSE_LEFT_CRICK ){
if( HitDispNo == <EFBFBD><EFBFBD>ťID ){
lssproto_WN_send(sockfd,nowGx,nowGy,indexWN,idWN,0,"1");
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=1;
}
}
//<2F>ر<EFBFBD>
if(MakeHitBox(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X+253,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-175,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X+283,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-149,1)==1){
StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X+270,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-160,105,40165,1);
if(mouse.onceState & MOUSE_LEFT_CRICK && !ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>){
windowTypeWN = -1;
wnCloseFlag = 1;
}
}
if(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>){
StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X-186,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-58,111,40088,1);
StockFontBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X-138,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y-16,2,0,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0);
<EFBFBD><EFBFBD>ťID = StockDispBuffer(ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X+5,ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Y+37,112,26042,2);
if( mouse.onceState & MOUSE_LEFT_CRICK ){
if( HitDispNo == <EFBFBD><EFBFBD>ťID ){
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=0;
memset(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0,1024);
}
}
}
if(CheckMenuFlag()
|| ((joy_trg[ 0 ] & JOY_ESC) && GetImeString() == NULL)
|| actBtn == 1
|| menuBtn == 1
|| disconnectServerFlag == TRUE
|| wnCloseFlag == 1
|| cloasewindows == 1) <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>();
return ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ;
}
void <EFBFBD><EFBFBD>ǩ<EFBFBD><EFBFBD>״̬(int ״̬)
{
ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.״̬=״̬;
}
#endif