网络数据模块.bas
资源名称:vbmcrisrc.rar [点击查看]
上传用户:pcw2004
上传日期:2022-02-02
资源大小:743k
文件大小:9k
源码类别:
DirextX编程
开发平台:
Visual Basic
- Attribute VB_Name = "网络数据模块"
- Option Explicit
- Public mLoginName As String
- ' Download by http://www.codefans.net
- Public ServerIP As String
- Public ServerPort As Long
- Public Const NETKONGDATA = "##"
- Public Const KONGDATA = "$#"
- Public Const WALKDATA = 1001 '走(WALKDATA 玩家编号 X Y 方向 )
- Public Const RUNDATA = 1002 '跑(RUNDATA 玩家编号 X Y 方向 )
- Public Const PlayerNum = 1003 '主角编号(MAINNUM 编号)
- Public Const PlayerName = 1004 '玩家名字(PLAYERNAME 玩家编号 名字)
- Public Const NOWPLAYERCOUNT = 1005 '总在线玩家数(NOWPLAYERCOUNT 数量)
- Public Const PLAYERFACEDATA = 1006 '玩家方向(PLAYERFACEDATA 玩家编号 方向)
- Public Const PLAYERXY = 1007 '玩家XY(PLAYERXY 玩家编号 X Y)
- Public Const PLAYERMAGICDATA = 1008 '玩家施魔法(PLAYERMAGIC 玩家编号 玩家名字 玩家动作 魔法名称 X Y )
- '#########################################################################################################
- Public Const CLOTHINGDATA = 1009 '玩家装备(ZHUANGBEIDATA 玩家编号 是否有装备 装备属性)
- Public Const WEAPONDATA = 1010
- Public Const HEADPIECEDATA = 1011
- Public Const NECKLACEDATA = 1012
- Public Const FINGERRINGLEFTDATA = 1013
- Public Const FINGERRINGRIGHTDATA = 1014
- Public Const BRACELETLEFTDATA = 1015
- Public Const BRACELETRIGHTDATA = 1016
- '##########################################################################################################
- Public Const PLAYEREND = 1017 '玩家下线(PLAYEREND 玩家编号)
- Public Const PLAYERHP = 1018 '玩家HP( PLAYERHP 玩家编号 HP MaxHP)
- Public Const PLAYERMP = 1019 '玩家MP( PLAYERMP 玩家编号 MP MaxMP)
- Public Const SHANGHAIDATA = 1020 '伤害玩家(SHANGHAIDATA 玩家编号 攻击力 攻击类型-0物攻 1魔攻)
- Public Const PLAYERACTDATA = 1021 '玩家动作(PLAYERACTDATA 玩家编号 动作 动作帧)
- Public Const PLAYERJIAOYI = 1022 '玩家交易(PLAYERJIAOYI 玩家编号 被交易玩家编号)
- Public Const PLAYERJIAOYIEND = 1023 '玩家交易取消(PLAYERJIAOYIEND 玩家编号 被交易玩家编号)
- Public Const PLAYERJIAOYIITEM = 1024 '玩家交易物品(PLAYERJIAOYIITEM 被交易玩家编号 物品)
- Public Const PLAYERJIAOYIOK = 1025 '玩家交易确定(PLAYERJIAOYIOK 玩家编号 被交易玩家编号)
- '/////////////////////// 网络怪物数据 ////////////////////////
- Public Const NOWMONCOUNT = 1026 '怪物总数(NOWMONCOUNT 怪物数量)
- Public Const MonName = 1027 '怪物名称(MONNAME 怪物编号 怪物名字)
- Public Const MONXY = 1028 '怪物XY(MONXY 怪物ID X Y)
- Public Const MONFACE = 1029 '怪物方向(MONFACE 怪物ID 方向)
- Public Const MONMOVE = 1030 '怪物移动(MONMOVE 怪物ID X Y)
- Public Const MONATTACK = 1031 '怪物攻击(MONATTACK 怪物ID )
- Public Const MONSHANGHAI = 1032 '怪物伤害(MONSHANGHAI 怪物编号 攻击力 攻击类型-0物攻 1魔攻)
- Public Const MONHP = 1033 '怪物HP(MONHP 怪物编号 HP MAXHP)
- Public Const MONACTDATA = 1034 '怪物动作(MONACTDATA 怪物ID 动作 方向)
- Public Const PLAYERATTACKINFO = 1035 '玩家攻击属性(PLAYERATTACKINFO 玩家编号 攻击属性
- Public Const PLAYERFUHUO = 1036 '玩家复活(PLAYERFUHUO 玩家编号)
- Public Const TALKINFO = 1037 '聊天信息(TALKINFO 玩家编号 玩家名字 信息 信息颜色 信息类型[0玩家信息 1其它信息])
- Public Const SILIAOINFO = 1038 '私聊信息(SILIAOINFO 玩家编号 玩家名字 私聊玩家编号 私聊玩家名字 信息)
- Public Const SCRIPTDATAINFO = 1039 '脚本信息(SCRIPTDATAINFO NPC编号 脚本信息)
- Public Const SCRIPTFUNNAMEINFO = 1040 '脚本函数名(SCRIPTFUNNAME 玩家编号 NPC编号 函数名)
- Public Const MAPNPCINFO = 1041 '地图NPC(MAPNPCINFO NPC编号 X Y 名称 图像)
- Public Const MAPNPCCOUNTINFO = 1042 '地图NPC个数(MAPNPCCOUNTINFO NPC数量)
- Public Const PLAYERPK = 1043 '玩家PK值(PLAYERPK 玩家编号 PK值)
- Public Const PLAYERLEVEL = 1044 '玩家等级(PLAYERLEVEL 玩家编号 玩家名字 玩家等级)
- Public Const PLAYERGOLD = 1045 '玩家金币(PLAYERGOLD 玩家编号 玩家名字 金币)
- Public Const LOGINID = 1046 '登陆ID(LOGINID ID 状态(0失败1成功 信息)
- Public Const LOGINNAME = 1047 '登陆名字(LOGINNAME 名字 职业 性别)
- Public Const LOGINSTATE = 1048 '登陆状态(LOGINSTATE 状态(0失败1成功 )
- Public Const REGPLAYERID = 1049 '注册ID(REGPLAYERID 账号)
- Public Const REGIDSTATE = 1050 '注册状态(REGIDSTATE 状态(0失败1成功) 信息)
- Public Const GIVEITEMDATA = 1051 '得到物品(GIVEITEMDATA 玩家编号 玩家名字 物品数据 数量)
- Public Const SAVEHERODATA = 1052 '保存主角信息(SAVEHERODATA 编号 玩家名字 玩家等级 职业 性别)
- Public Const SELHERONUM = 1053 '选择主角编号(SELHERONUM 编号 玩家名字)
- Public Const REGHERONAME = 1054 '建立角色(REGHERONAME ID 角色名 职业 性别)
- Public Const PLAYERSEX = 1055 '玩家性别(PLAYERSEX 编号 玩家名 性别)
- Public Const TISHIDATA = 1056 '提示信息(TISHIDATA 错误信息)
- Public Const PLAYERATTACKDATA = 1057 '玩家物理攻击动作(PLAYERATTACKDATA 玩家编号)
- Public Const HEREPLAYERCOUNT = 1058 '附近玩家数量(HEREPLAYERCOUNT 玩家数)
- Public Const HEREPLAYERINFO = 1059 '附近玩家属性(HEREPLAYERINFO 编号 ID 名字 性别 方向 衣服外观 武器外观 头发外观 X Y)
- Public Const HEREMONCOUNT = 1060 '附近怪数量(HEREMONCOUNT 怪数量)
- Public Const HEREMONINFO = 1061 '附近怪属性(HEREMONINFO 编号 ID RACE RACEIMAGE Appr 名字 方向 X Y)
- Public Const HEREMAPITEMCOUNT = 1062 '附近地图上物品数量(HEREMAPITEMCOUNT 数量)
- Public Const HEREMAPITEMINFO = 1063 '附近地图上物品信息(HEREMAPITEMINFO 编号 ID 物品名字 物品外观 X Y)
- Public Const PLAYERGETEXP = 1064 '玩家获得经验(PLAYERGETEXP Exp)
- Public Const PLAYEREXPDATA = 1065 '玩家经验值(PLAYEREXPDATA EXP MAXEXP)
- Public Const CMDDATA = 1066 '命令(CMDDATA 命令)
- Public Const JIANITEMDATA = 1067 '捡地图上物品(JIANITEMDATA 物品ID X Y)
- Public Const PLAYERBAGITEMDATA = 1068 '发送玩家包裹物品信息(PLAYERBAGITEMDATA 物品ID 物品信息)
- Public Const PLAYERBAGINFO = 1069 '请求发送玩家包裹物品信息(PLAYERBAGINFO 编号)
- Public Const PLAYERDUIITEM = 1070 '玩家丢掉物品(PLAYERDUIITEM 物品ID)
- '////////// 玩家攻击属性组成文本
- Public Function PlayerInfoStr(PlayerNum As Integer) As String
- PlayerInfoStr = Player(PlayerNum).AC1 & "$$" & Player(PlayerNum).Ac2 & "$$" & Player(PlayerNum).MAC1 & "$$" & _
- Player(PlayerNum).Mac2 & "$$" & Player(PlayerNum).DC1 & "$$" & Player(PlayerNum).Dc2 & "$$" & _
- Player(PlayerNum).MC1 & "$$" & Player(PlayerNum).Mc2 & "$$" & Player(PlayerNum).SC1 & "$$" & _
- Player(PlayerNum).Sc2
- End Function
- '///////// 从文本中获取玩家攻击属性
- Public Sub GetPlayerInfo(PlayerNum As Integer, InfoStr As String)
- Dim nData As Variant
- nData = Split(InfoStr, "$$")
- Player(PlayerNum).AC1 = nData(0)
- Player(PlayerNum).Ac2 = nData(1)
- Player(PlayerNum).MAC1 = nData(2)
- Player(PlayerNum).Mac2 = nData(3)
- Player(PlayerNum).DC1 = nData(4)
- Player(PlayerNum).Dc2 = nData(5)
- Player(PlayerNum).MC1 = nData(6)
- Player(PlayerNum).Mc2 = nData(7)
- Player(PlayerNum).SC1 = nData(8)
- Player(PlayerNum).Sc2 = nData(9)
- End Sub
- '/////// 装备属性组成文本
- Public Function ItemStr(mItem As ItemType) As String
- ItemStr = mItem.Idx & "%%" & mItem.Name & "%%" & mItem.StdMode & "%%" & _
- mItem.Shape & "%%" & mItem.Weight & "%%" & mItem.Anicount & "%%" & mItem.Source & "%%" & _
- mItem.Reserved & "%%" & mItem.Looks & "%%" & mItem.DuraMax & "%%" & _
- mItem.AC & "%%" & mItem.Ac2 & "%%" & mItem.MAC & "%%" & mItem.Mac2 & "%%" & _
- mItem.DC & "%%" & mItem.Dc2 & "%%" & mItem.MC & "%%" & mItem.Mc2 & "%%" & _
- mItem.SC & "%%" & mItem.Sc2 & "%%" & mItem.Need & "%%" & mItem.NeedLevel & "%%" & _
- mItem.Price
- End Function
- Public Sub mSleep(mTime As Long)
- Dim mmm As Long
- mmm = GetTickCount
- Do While GetTickCount - mmm < mTime
- DoEvents
- Loop
- End Sub
- '///////// 从文本中获取装备属性
- Public Function GetItem(Str As String) As ItemType
- Dim i As Integer
- Dim mData As Variant
- mData = Split(Str, "%%")
- GetItem.Idx = mData(0)
- GetItem.Name = mData(1)
- GetItem.StdMode = mData(2)
- GetItem.Shape = mData(3)
- GetItem.Weight = mData(4)
- GetItem.Anicount = mData(5)
- GetItem.Source = mData(6)
- GetItem.Reserved = mData(7)
- GetItem.Looks = mData(8)
- GetItem.DuraMax = mData(9)
- GetItem.AC = mData(10)
- GetItem.Ac2 = mData(11)
- GetItem.MAC = mData(12)
- GetItem.Mac2 = mData(13)
- GetItem.DC = mData(14)
- GetItem.Dc2 = mData(15)
- GetItem.MC = mData(16)
- GetItem.Mc2 = mData(17)
- GetItem.SC = mData(18)
- GetItem.Sc2 = mData(19)
- GetItem.Need = mData(20)
- GetItem.NeedLevel = mData(21)
- GetItem.Price = mData(22)
- End Function
- '//////// 获取物品编号
- Public Function GetItemNum(ItemName As String) As Integer
- Dim i As Integer
- For i = 1 To ItemDBCount
- If ItemDB(i).Name = ItemName Then
- GetItemNum = i
- Exit For
- End If
- Next
- End Function