Files
mir-godot/wiki/course/2.0.0.md
makeyangcom ec29d74471 2.0.0
2024-03-07 12:26:48 +08:00

141 lines
5.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 第二课
> 第二课时操作引导文档。
### 更新课程源码
```shell
git pull
```
### 虚拟IP地址固定
> 根据课程在Hyper-V管理器中进行相关的设置
### GitHub的访问加速
> 将wiki目录中hosts文件中的服务器IP修改后覆盖到`C:\Windows\System32\drivers\etc`
> 将wiki目录中config文件中的服务器IP修改后覆盖到`C:\Users\用户名\.ssh`
> 根据课程创建自己的代码仓库并上传源码到自己的仓库
```shell
# 上传源码到仓库的命令脚本
git add .;git commit -m "main";git push origin main
# 或执行脚本文件
./push.bat
```
### GoLand编辑器配置
> 根据课程配置GoLang代理加速依赖库的下载
```shell
GOPROXY=https://goproxy.io,direct
```
> 根据课程下载后端Go程序的依赖库
```shell
go mod download
```
### 数据库管理工具
> 修改数据库配置中的IP地址为虚拟机的实际IP地址
> 创建名为`database`的数据库
```shell
database
```
> 执行下面的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`) USING BTREE
) 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='游戏服务器数据表';
```
> 执行下面的MySQL脚本创建游戏玩家数据表
```mysql
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启用',
`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 (`player_id`),
KEY `status` (`player_status`) USING BTREE,
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='游戏玩家数据表';
```
> 执行下面的MySQL脚本创建游戏地图数据表
```mysql
CREATE TABLE `game_map_data` (
`map_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`map_server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器编号',
`map_number` varchar(50) NOT NULL DEFAULT '' COMMENT '地图编号',
`map_name` varchar(50) NOT NULL DEFAULT '' COMMENT '地图名称',
`map_default_x` int(11) NOT NULL DEFAULT '0' COMMENT '默认X坐标',
`map_default_y` int(11) NOT NULL DEFAULT '0' COMMENT '默认Y坐标',
`map_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 (`map_id`),
KEY `status` (`map_status`) USING BTREE,
KEY `server_id` (`map_server_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='游戏地图数据表';
```