资源简介
一款完整的游戏源代码,大家可以学习学习!

代码片段和文件信息
// Arminius‘ protocol utilities ver 0.1
//
// Any questions and bugs mailto: arminius@mail.hwaei.com.tw
// -------------------------------------------------------------------
// The following definitions is to define game-dependent codes.
// Before compiling remove the “//“.
#define __STONEAGE
#include “version.h“
#include
#include
#include “autil.h“
#include “char.h“
#ifdef __STONEAGE
#include “lssproto_util.h“
#include “common.h“
#endif
// Nuke 0701 fix
char *MesgSlice[SLICE_MAX];
int SliceCount;
char PersonalKey[4096];
// -------------------------------------------------------------------
// Initialize utilities
//
BOOL util_Init( void)
{
int i;
for (i=0; i MesgSlice[i] = (char *) calloc( 1SLICE_SIZE);
if(MesgSlice[i]==NULL) return FALSE;
}
SliceCount = 0;
strcpy(PersonalKey _DEFAULT_PKEY);
return TRUE;
}
// -------------------------------------------------------------------
// Split up a message into slices by spearator. Store those slices
// into a global buffer “char **MesgSlice“
//
// arg: source=message string; separator=message separator (1 byte)
// ret: (none)
// WON ADD
//void util_SplitMessage(char *source char *separator)
BOOL util_SplitMessage(char *source char *separator)
{
if (source && separator) { // NULL input is invalid.
char *ptr;
char *head = source;
// Nuke 1006 : Bug fix
while ((ptr = (char *) strstr(head separator)) && (SliceCount=0)) {
ptr[0] = ‘\0‘;
if (strlen(head)
// Nuke 0701
// if (*MesgSlice != *dumb) {
//print(“Warning! Mem may be broken\n“);
//}
/*
if (MesgSlice[SliceCount]==0xffffffff) {
print(“MesgSlice[%d] broken\n“SliceCount);
return FALSE;
} else {
*/
strcpy(MesgSlice[SliceCount] head);
SliceCount++;
//}
}
head = ptr+1;
}
strcpy(source head); // remove splited slices
}
return TRUE;
}
// -------------------------------------------------------------------
// Encode the message
//
// arg: dst=output src=input
// ret: (none)
void util_EncodeMessage(char *dst char *src)
{
// strcpy(dst src);
// util_xorstring(dst src);
int rn = rand() % 99;
int t1 t2;
char t3[65500] tz[65500];
// encode seed
#ifdef _BACK_VERSION
util_swapint(&t1 &rn “3421“);
#else
util_swapint(&t1 &rn “2413“);
#endif
t2 = t1 ^ 0xffffffff;
util_256to64(tz (char *) &t2 sizeof(int) DEFAULTTABLE);
util_shlstring(t3 src rn);
strcat(tz t3);
util_xorstring(dst tz);
}
// -------------------------------------------------------------------
// Decode the message
//
// arg: dst=output src=input
// ret: (none)
void util_DecodeMessage(char *dst char *src)
{
// strcpy(dst src);
// util_x
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 14872 2004-08-10 10:34 石器时代\gmsv\autil.c
文件 285652 2004-12-20 15:30 石器时代\gmsv\battle\battle.c
文件 17680 2004-08-10 10:34 石器时代\gmsv\battle\battle_ai.c
文件 32586 2004-12-16 13:56 石器时代\gmsv\battle\battle_command.c
文件 305841 2004-12-21 11:22 石器时代\gmsv\battle\battle_event.c
文件 31543 2004-12-08 09:58 石器时代\gmsv\battle\battle_item.c
文件 170153 2004-12-21 10:00 石器时代\gmsv\battle\battle_magic.c
文件 14823 2004-08-10 10:34 石器时代\gmsv\battle\Makefile
文件 76054 2004-12-16 15:45 石器时代\gmsv\battle\pet_skill.c
文件 40308 2004-08-11 16:45 石器时代\gmsv\battle\profession_skill.c
文件 176 2004-12-21 11:22 石器时代\gmsv\battle\vssver.scc
文件 4823 2004-08-10 10:34 石器时代\gmsv\buf.c
文件 58501 2004-11-24 09:59 石器时代\gmsv\callfromac.c
文件 67261 2004-10-01 11:33 石器时代\gmsv\callfromcli.c
文件 26782 2004-08-10 10:34 石器时代\gmsv\char\addressbook.c
文件 268196 2004-12-16 14:37 石器时代\gmsv\char\char.c
文件 22050 2004-09-10 11:46 石器时代\gmsv\char\char_angel.c
文件 113876 2004-12-08 09:58 石器时代\gmsv\char\char_ba
文件 57965 2004-10-08 15:28 石器时代\gmsv\char\char_data.c
文件 19067 2004-09-29 09:38 石器时代\gmsv\char\char_event.c
文件 75269 2004-11-25 21:02 石器时代\gmsv\char\char_item.c
文件 20563 2004-09-01 09:37 石器时代\gmsv\char\char_party.c
文件 42116 2004-12-08 11:07 石器时代\gmsv\char\char_talk.c
文件 44624 2004-08-10 10:34 石器时代\gmsv\char\char_walk.c
文件 152500 2004-12-08 11:13 石器时代\gmsv\char\chatmagic.c
文件 32151 2004-08-10 10:34 石器时代\gmsv\char\chatroom.c
文件 60772 2004-09-02 14:20 石器时代\gmsv\char\deathcontend.c
文件 4602 2004-08-10 10:34 石器时代\gmsv\char\defaultGroundEnemy.h
文件 11380 2004-11-24 09:59 石器时代\gmsv\char\defaultPla
文件 520 2004-08-10 10:34 石器时代\gmsv\char\defend.c
............此处省略363个文件信息
相关资源
- 自已写的 自习室预约小程序微信125
- 基于stm32f103ve的程序——跑马灯实验
- 基于STM32RCT6的步进电机驱动程序
- E4A无障碍跨程序操作类库(带源码、
- labview魔方程序
- 程序员专用字体YaHei.Consolas.1.11b42517
- scratch3.0 源程序(说相声)
- 欧姆龙CP1系列单轴定位PLC程序.cxp
- SVR算法程序可运行
- labview编程软件滤波器以及编写程序设
- 电力系统潮流计算程序集合
- 仿知乎界面小程序源代码
- STM32蓝牙和串口程序
- elantech触控板驱动程序 v13.6.11 官方最
- 根据硬件ID和程序ID生成注册码
- 用python编写的移动彩信的发送程序
- TCL-S1916 ,1924交换机管理程序
- 51单片机PWM程序,占空比、周期可调整
- 嵌入式图形界面MiniGUI的示例程序9例
- 数字频率合成dds正弦波基于FPGA的DDS产
- 28335CAN调试程序
- 导线测量平差程序 很实用
- USB转串口驱动,FT232R驱动程序,最新
- 改进的BP神经网络算法
- 通风网络解算程序 fortran90
- 编写简单的RMI程序 多线程web 服务器
- 图论软件包(图论里的程序)
- A星算法_原理讲解_例子
- MFC程序-碰撞的小球
- 德卡D3读卡器测试程序驱动文件
评论
共有 条评论