This commit is contained in:
makeyangcom
2024-03-07 12:15:34 +08:00
parent 91b6141418
commit 5f394e80dd
2 changed files with 85 additions and 18 deletions

9
wiki/config Normal file
View File

@@ -0,0 +1,9 @@
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Host 172.20.74.71
KexAlgorithms +diffie-hellman-group1-sha1

View File

@@ -16,48 +16,106 @@ git pull
> 将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脚本创建游戏账号数据表
```mysql
CREATE TABLE `game_play_data` (
`user_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`user_server_id` int(11) NOT NULL DEFAULT '0' COMMENT '服务器编号',
`user_account` varchar(140) NOT NULL DEFAULT '' COMMENT '账号',
`user_password` varchar(50) NOT NULL DEFAULT '' COMMENT '密码',
`user_name` varchar(50) NOT NULL DEFAULT '' COMMENT '真实姓名',
`user_number` varchar(140) NOT NULL DEFAULT '' COMMENT '身份证号码',
`user_question_a` varchar(140) NOT NULL DEFAULT '' COMMENT '问题',
`user_question_b` varchar(140) NOT NULL DEFAULT '' COMMENT '问题二',
`user_answer_a` varchar(140) NOT NULL DEFAULT '' COMMENT '答案',
`user_answer_b` varchar(140) NOT NULL DEFAULT '' COMMENT '答案二',
`user_status` tinyint(2) NOT NULL DEFAULT '2' COMMENT '状态 1停用 2启用',
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 (`user_id`),
KEY `status` (`user_status`),
KEY `server_id` (`user_server_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='游戏用户数据表';
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='游戏服务器数据表';
```
> 执行下面的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`),
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='游戏玩家数据表';
```