# Skynet **Repository Path**: codesignup/skynet ## Basic Information - **Project Name**: Skynet - **Description**: 阅读skynet源码时使用的注释版本 - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 7 - **Created**: 2022-06-24 - **Last Updated**: 2022-06-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README skynet源码阅读笔记 =============== 阅读源码时记录下的笔记 * 百度云盘地址: https://pan.baidu.com/s/1As0dU7Gb3uieSu35tOXZ0g?pwd=mrnq * 提取码: mrnq ## 碎碎念 使用高版本的g++对jemalloc进行编译会有一堆奇怪的错误报出,无法解决,实测4.8以上版本无法成功编译,最终使用g++ 4.4.7将jemalloc的lib库编译出来,并放到了项目文件中。另sampleService文件夹中是仿照example文件夹中的例程仿写的skynet应用(随便写的)。加油,小奥比! 根目录下的./skynet可执行文件是应用程序,我们在启动这个应用程序的时候需要给它输入参数,如:./skynet ./sampleService/config,这样一来config文件的相对路径被输入到./skynet程序中,程序启动时会对./config的内容进行读取,运行。其中start那一项指定了./skynet启动时会启动的主服务,相当于我们C程序的main函数。 ## Introduction Skynet is a lightweight online game framework which can be used in many other fields. ## Build For Linux, install autoconf first for jemalloc: ``` git clone https://github.com/cloudwu/skynet.git cd skynet make 'PLATFORM' # PLATFORM can be linux, macosx, freebsd now ``` Or: ``` export PLAT=linux make ``` For FreeBSD , use gmake instead of make. ## Test Run these in different consoles: ``` ./skynet examples/config # Launch first skynet node (Gate server) and a skynet-master (see config for standalone option) ./3rd/lua/lua examples/client.lua # Launch a client, and try to input hello. ``` ## About Lua version Skynet now uses a modified version of lua 5.4.4 ( https://github.com/ejoy/lua/tree/skynet54 ) for multiple lua states. Official Lua versions can also be used as long as the Makefile is edited. ## How To Use * Read Wiki for documents https://github.com/cloudwu/skynet/wiki * The FAQ in wiki https://github.com/cloudwu/skynet/wiki/FAQ