px_ls_common.c

来自「MMORPG游戏服务器端架构及函数」· C语言 代码 · 共 89 行

C
89
字号
#pragma	  once

/* must been first include begin */
#include "..\ProjectX_Common\ProjectX_Copyright.h"
#include "..\ProjectX_Common\ProjectX_Common.h"
/* must been first include end */

/* std and common include */
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

#include "px_ls_common.h"


extern PX_LS_PERFORMANCE *  g_performance;
extern HASH_TABLE_RS	 *	g_hash_table_rs;				//指向rs模块用来快速搜索hash表
extern HASH_TABLE_DBES	 *	g_hash_table_dbes;				//指向dbes模块用来快速搜索hash表


int calculate_rs_hash_key(unsigned int ip,u_short port){
	unsigned int ip_t;
	int iret = 0;
	ip_t = ip;
	ip_t &= 0xFF;
	iret = ip_t;
	ip_t = ip;
	ip_t &= 0xFF00;
	ip_t = ip_t >> 8;
	iret += ip_t;
	ip_t = ip;
	ip_t &= 0xFF0000;
	ip_t = ip_t >> 16;
	iret += ip_t;
	ip_t = ip;
	ip_t = ip_t >> 24;
	iret += ip_t;
	iret += port;
	return iret;
}

int calculate_dbes_hash_key(unsigned int account_uid,unsigned int char_uid){
	unsigned int i;
	int iret = 0;
	i = account_uid;
	i &= 0xFF;
	iret = i;
	i = account_uid;
	i &= 0xFF00;
	i = i >> 8;
	iret += i;
	i = account_uid;
	i &= 0xFF0000;
	i = i >> 16;
	iret += i;
	i = account_uid;
	i &= 0xFF0000;
	i = i >> 24;
	iret += i;
	//
	i = char_uid;
	i &= 0xFF;
	iret += i;
	i = char_uid;
	i &= 0xFF00;
	i = i >> 8;
	iret += i;
	i = char_uid;
	i &= 0xFF0000;
	i = i >> 16;
	iret += i;
	i = char_uid;
	i &= 0xFF0000;
	i = i >> 24;
	iret += i;
	return iret;
}
void calculate_ls_performance(){
	return;
}
BOOL valid_ls_performance_better(byte performance){
	return TRUE;
}
BOOL valid_ls_performance_equal(byte performance){
	return TRUE;
}
void update_ls_performance(int frame){
	return;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?