Exemplo n.º 1
0
/*
====================
MsgCreateSystem

====================
*/
int CParticleEngine::MsgCreateSystem( const char *pszName, int iSize, void *pbuf ) 
{
	BEGIN_READ(pbuf, iSize);

	vec3_t pos;
	pos.x = READ_COORD();
	pos.y = READ_COORD();
	pos.z = READ_COORD();

	vec3_t ang;
	ang.x = READ_COORD();
	ang.y = READ_COORD();
	ang.z = READ_COORD();

	int iType = READ_BYTE();
	char *szPath = READ_STRING();
	int iId = READ_SHORT();

	if(iType == 2)
		RemoveSystem(iId);
	else if(iType == 1)
		CreateCluster(szPath, pos, ang, iId);
	else
		CreateSystem(szPath, pos, ang, iId);

	return 1;
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
    printf("Nezha Database System Server Engine Starts\n");
    char * addr;
    int    port;
    if (argc != 3) 
    {
        addr = IP_ADDR;
        port = PORT;
        CreateCluster(addr,port);
    }
    else
    {
        addr = argv[1];
        port = atoi(argv[2]);
        LoadingClusterNodes(addr,port);       
    }
    /* start command line console */
    pthread_t cmdline_id;
    if(pthread_create(&cmdline_id,NULL,(void*)cmdline,(void*)0) != 0)
    {
        fprintf(stderr,"cmdline pthread_create Error,%s:%d\n",__FILE__,__LINE__);
        exit(-1);
    } 
    ServiceEngine(addr,port);
    return 0;
}
CassDriver::CassDriver() {
  InitLogLevelMap();
  CreateCluster();
  ConnectSession();
  PrepareQuery();
}