Files
mir-godot/wiki/course/2.0.0.md

121 lines
4.7 KiB
Markdown
Raw Normal View History

2024-03-07 10:37:07 +08:00
## 第二课
> 第二课时操作引导文档。
### 更新课程源码
```shell
2024-03-07 11:58:00 +08:00
git pull
```
### 虚拟IP地址固定
> 根据课程在Hyper-V管理器中进行相关的设置
### GitHub的访问加速
> 将wiki目录中hosts文件中的服务器IP修改后覆盖到`C:\Windows\System32\drivers\etc`
2024-03-07 12:15:34 +08:00
> 将wiki目录中config文件中的服务器IP修改后覆盖到`C:\Users\用户名\.ssh`
2024-03-07 11:58:00 +08:00
> 根据课程创建自己的代码仓库并上传源码到自己的仓库
```shell
# 上传源码到仓库的命令脚本
git add .;git commit -m "main";git push origin main
2024-03-07 12:15:34 +08:00
# 或执行脚本文件
./push.bat
2024-03-07 10:37:07 +08:00
```
### GoLand编辑器配置
2024-03-07 12:15:34 +08:00
> 根据课程配置GoLang代理加速依赖库的下载
2024-03-07 10:37:07 +08:00
```shell
GOPROXY=https://goproxy.io,direct
```
2024-03-07 12:15:34 +08:00
> 根据课程下载后端Go程序的依赖库
```shell
go mod download
```
2024-03-07 10:37:07 +08:00
### 数据库管理工具
2024-03-07 12:15:34 +08:00
> 修改数据库配置中的IP地址为虚拟机的实际IP地址
2024-03-07 10:37:07 +08:00
> 创建名为`database`的数据库
```shell
database
```
2024-03-07 12:15:34 +08:00
> 执行下面的MySQL脚本创建游戏账号数据表
```mysql
CREATE TABLE `game_account_data` (
`account_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`account_account` varchar(140) NOT NULL DEFAULT '' COMMENT '邮箱账号',
`account_password` varchar(50) NOT NULL DEFAULT '' COMMENT '密码',
`account_name` varchar(50) NOT NULL DEFAULT '' COMMENT '真实姓名',
`account_number` varchar(140) NOT NULL DEFAULT '' COMMENT '身份证号码',
`account_question_a` varchar(140) NOT NULL DEFAULT '' COMMENT '问题一',
`account_question_b` varchar(140) NOT NULL DEFAULT '' COMMENT '问题二',
`account_answer_a` varchar(140) NOT NULL DEFAULT '' COMMENT '答案一',
`account_answer_b` varchar(140) NOT NULL DEFAULT '' COMMENT '答案二',
`account_status` tinyint(2) NOT NULL DEFAULT '2' COMMENT '状态 1停用 2启用',
`create_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`delete_at` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`account_id`),
KEY `status` (`account_status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='游戏账号数据表';
```
> 执行下面的MySQL脚本创建游戏服务器数据表
```mysql
CREATE TABLE `game_server_data` (
`server_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`server_name` varchar(50) NOT NULL DEFAULT '' COMMENT '服务器名称',
`server_status` tinyint(2) NOT NULL DEFAULT '2' COMMENT '状态 1停用 2启用',
`create_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`delete_at` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`server_id`),
KEY `status` (`server_status`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='游戏服务器数据表';
```
2024-03-07 10:37:07 +08:00
> 执行下面的MySQL脚本创建游戏玩家数据表
```mysql
2024-03-07 12:15:34 +08:00
CREATE TABLE `game_player_data` (
`player_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`player_account_id` int(11) NOT NULL DEFAULT '0' COMMENT '账号编号',
`player_server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器编号',
`player_nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
`player_career` varchar(20) NOT NULL DEFAULT '' COMMENT '职业',
`player_gender` varchar(20) NOT NULL DEFAULT '' COMMENT '性别',
`player_angle` int(11) NOT NULL DEFAULT '2' COMMENT '角度',
`player_map` varchar(50) NOT NULL DEFAULT '' COMMENT '地图',
`player_map_x` int(11) NOT NULL DEFAULT '0' COMMENT '地图X坐标',
`player_map_y` int(11) NOT NULL DEFAULT '0' COMMENT '地图Y坐标',
`player_asset_life` int(11) NOT NULL DEFAULT '0' COMMENT '生命值',
`player_asset_magic` int(11) NOT NULL DEFAULT '0' COMMENT '魔法值',
`player_asset_experience` int(11) NOT NULL DEFAULT '0' COMMENT '经验值',
`player_body_clothe` varchar(50) NOT NULL DEFAULT '' COMMENT '衣服',
`player_body_weapon` varchar(50) NOT NULL DEFAULT '' COMMENT '武器',
`player_body_wing` varchar(50) NOT NULL DEFAULT '' COMMENT '翅膀',
`player_group_id` int(11) NOT NULL DEFAULT '1' COMMENT '权限组',
`player_status` tinyint(2) NOT NULL DEFAULT '2' COMMENT '状态 1停用 2启用',
2024-03-07 10:37:07 +08:00
`create_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`delete_at` int(11) NOT NULL DEFAULT '0',
2024-03-07 12:15:34 +08:00
PRIMARY KEY (`player_id`),
KEY `status` (`player_status`),
KEY `account_id` (`player_account_id`) USING BTREE,
KEY `server_id` (`player_server_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='游戏玩家数据表';
2024-03-07 10:37:07 +08:00
```