-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
375 lines (339 loc) · 72.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Almango - 天真永不消逝,浪漫至死不渝</title><meta name="author" content="Almango"><meta name="copyright" content="Almango"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="天真永不消逝,浪漫至死不渝">
<meta property="og:type" content="website">
<meta property="og:title" content="Almango">
<meta property="og:url" content="https://almango.cn/index.html">
<meta property="og:site_name" content="Almango">
<meta property="og:description" content="天真永不消逝,浪漫至死不渝">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://almango.cn/img/Head.png">
<meta property="article:author" content="Almango">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://almango.cn/img/Head.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://almango.cn/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>
(() => {
const saveToLocal = {
set: (key, value, ttl) => {
if (!ttl) return
const expiry = Date.now() + ttl * 86400000
localStorage.setItem(key, JSON.stringify({ value, expiry }))
},
get: key => {
const itemStr = localStorage.getItem(key)
if (!itemStr) return undefined
const { value, expiry } = JSON.parse(itemStr)
if (Date.now() > expiry) {
localStorage.removeItem(key)
return undefined
}
return value
}
}
window.btf = {
saveToLocal,
getScript: (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
Object.entries(attr).forEach(([key, val]) => script.setAttribute(key, val))
script.onload = script.onreadystatechange = () => {
if (!script.readyState || /loaded|complete/.test(script.readyState)) resolve()
}
script.onerror = reject
document.head.appendChild(script)
}),
getCSS: (url, id) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onload = link.onreadystatechange = () => {
if (!link.readyState || /loaded|complete/.test(link.readyState)) resolve()
}
link.onerror = reject
document.head.appendChild(link)
}),
addGlobalFn: (key, fn, name = false, parent = window) => {
if (!false && key.startsWith('pjax')) return
const globalFn = parent.globalFn || {}
globalFn[key] = globalFn[key] || {}
if (name && globalFn[key][name]) return
globalFn[key][name || Object.keys(globalFn[key]).length] = fn
parent.globalFn = globalFn
}
}
const activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
const activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
btf.activateDarkMode = activateDarkMode
btf.activateLightMode = activateLightMode
const theme = saveToLocal.get('theme')
theme === 'dark' ? activateDarkMode() : theme === 'light' ? activateLightMode() : null
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
document.documentElement.classList.toggle('hide-aside', asideStatus === 'hide')
}
const detectApple = () => {
if (/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)) {
document.documentElement.classList.add('apple')
}
}
detectApple()
})()
</script><link rel="stylesheet" href="https://fonts.font.im/css?family=Didact+Gothic|Fredoka+One" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"未找到符合您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
translate: undefined,
noticeOutdate: {"limitDay":256,"position":"top","messagePrev":"温馨提示:该文章自上次更新以来的天数已超过","messageNext":"天,文章内容可能已过时,请慎阅……"},
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":300,"highlightFullpage":false,"highlightMacStyle":false},
copy: {
success: '复制成功',
error: '复制失败',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '',
dateSuffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
buttonText: '加载更多'
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'Almango',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-11-23 13:28:34'
}</script><link rel='stylesheet' href='https://chinese-fonts-cdn.deno.dev/packages/lywkpmydb/dist/LXGWWenKaiMonoScreen/result.css' /><link rel="stylesheet" href="/css/modify.css"><link rel="stylesheet" href="/css/font.css"><span id="fps"></span><link rel="stylesheet" href="/css/fps.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="/css/custom.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-footer-beautify@1.0.0/lib/runtime.css" media="print" onload="this.media='all'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg" style="background-image: url(https://www.loliapi.com/acg/pc/);"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img text-center"><img src="/img/Head.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data text-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">80</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">51</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">29</div></a></div><div class="menus_items"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-pencil-01"></i><span> 工具</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.feijipan.com"><i class="fa-fw iconfont icon-zhifeiji-copy"></i><span> 小飞机网盘</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://snake.timeline.ink/latest"><i class="fa-fw iconfont icon-bizhishezhi"></i><span> 拾光壁纸</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-wenzhang"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw iconfont icon-guidang"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw iconfont icon-biaoqian"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw iconfont icon-fenlei"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-icon-shishi"></i><span> 学习笔记</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/CSharp/"><i class="fa-fw iconfont icon-csharp"></i><span> C#</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/cpp/"><i class="fa-fw iconfont icon-cpp"></i><span> C++</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Python/"><i class="fa-fw iconfont icon-python"></i><span> Python</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/JavaScript/"><i class="fa-fw iconfont icon-JavaScript"></i><span> JavaScript</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-lianjie"></i><span> 友人帐</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travel.moe/go.html?travel=on"><i class="fa-fw iconfont icon-ditie"></i><span> 开往</span></a></div><div class="menus_item"><a class="site-page" href="/2024/07/18/Butterfly%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9%E6%97%A5%E5%BF%97/"><i class="fa-fw iconfont icon-fuwurizhi"></i><span> 日志</span></a></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-shoucang"></i><span> 我的</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/album/"><i class="fa-fw iconfont icon-xiangce"></i><span> 相册</span></a></li><li><a class="site-page child" href="/equipment/"><i class="fa-fw iconfont icon-backpack"></i><span> 装备</span></a></li><li><a class="site-page child" href="/2024/07/19/%E9%9A%8F%E5%BF%83%E6%97%A5%E8%AE%B0/"><i class="fa-fw iconfont icon-gangbi"></i><span> 日记</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-guanyu"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background: transparent;"><nav id="nav"><span id="blog-info"><a class="nav-site-title" href="/"><span class="site-name">Almango</span></a></span><div id="menus"><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></span></div><div class="menus_items"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-pencil-01"></i><span> 工具</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.feijipan.com"><i class="fa-fw iconfont icon-zhifeiji-copy"></i><span> 小飞机网盘</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://snake.timeline.ink/latest"><i class="fa-fw iconfont icon-bizhishezhi"></i><span> 拾光壁纸</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-wenzhang"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw iconfont icon-guidang"></i><span> 归档</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw iconfont icon-biaoqian"></i><span> 标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw iconfont icon-fenlei"></i><span> 分类</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-icon-shishi"></i><span> 学习笔记</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/CSharp/"><i class="fa-fw iconfont icon-csharp"></i><span> C#</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/cpp/"><i class="fa-fw iconfont icon-cpp"></i><span> C++</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Python/"><i class="fa-fw iconfont icon-python"></i><span> Python</span></a></li><li><a class="site-page child" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/JavaScript/"><i class="fa-fw iconfont icon-JavaScript"></i><span> JavaScript</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw iconfont icon-lianjie"></i><span> 友人帐</span></a></div><div class="menus_item"><a class="site-page" target="_blank" rel="noopener" href="https://travel.moe/go.html?travel=on"><i class="fa-fw iconfont icon-ditie"></i><span> 开往</span></a></div><div class="menus_item"><a class="site-page" href="/2024/07/18/Butterfly%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9%E6%97%A5%E5%BF%97/"><i class="fa-fw iconfont icon-fuwurizhi"></i><span> 日志</span></a></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw iconfont icon-shoucang"></i><span> 我的</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/album/"><i class="fa-fw iconfont icon-xiangce"></i><span> 相册</span></a></li><li><a class="site-page child" href="/equipment/"><i class="fa-fw iconfont icon-backpack"></i><span> 装备</span></a></li><li><a class="site-page child" href="/2024/07/19/%E9%9A%8F%E5%BF%83%E6%97%A5%E8%AE%B0/"><i class="fa-fw iconfont icon-gangbi"></i><span> 日记</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw iconfont icon-guanyu"></i><span> 关于</span></a></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><div id="site-info"><h1 id="site-title">Almango</h1><div id="site-subtitle"><span id="subtitle"></span></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts nc" id="recent-posts"><div class="recent-post-items"><div class="recent-post-item"><div class="post_cover left"><a href="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/" title="我的世界Java版本搭建本地服务器:实现开服与联机自由"><img class="post-bg" src="https://www.minecraft.net/content/dam/minecraftnet/games/minecraft/screenshots/EXPLORE_PDPScreenshotRefresh2024_multipleBiomes_01.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="我的世界Java版本搭建本地服务器:实现开服与联机自由"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/" title="我的世界Java版本搭建本地服务器:实现开服与联机自由">我的世界Java版本搭建本地服务器:实现开服与联机自由</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-11-15T06:34:01.000Z" title="发表于 2024-11-15 14:34:01">2024-11-15</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B8%B8%E6%88%8F/">游戏</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B8%B8%E6%88%8F/Minecraft/">Minecraft</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/#post-comment"><span class="waline-comment-count" data-path="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content"> 最近因为某些原因,我和兄弟临时转MC玩了,开始是考虑了一下冈易我的世界,但想到冈易那代理mc环境跟一坨一样,甚至高质量的光影全要钱,干脆不如玩纯净版的MC,于是就想着自己搭建一个本地服务器。虽然第一次有点麻烦,但我还是将全过程记录了下来。 本期介绍的是Java版我的世界本地服务器和实现多人联机的实现过程:仅供参考 前提条件 Java 11或以上版本1 Minecraft Edition 任意版本 部署Server核心 服务器核心文件是一个JAR文件,内部的文件按下列结构组织,是用于运行服务器的软件。在这个软件中,有几个核心要素是关键的,它们共同构成了服务器的基础架构。以下是我的世界服务器核心的主要组成部分 常用的Minecraft服务器核心有以下几种: Bukkit Paper Velocity Spigot 这里我就以Spigot为例,搭建一个本地服务器。 注意:Spigot版本不能低于Minecraft游戏版本。 1 ....</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/" title="Unity2D开发记录_游戏场景搭建【1】"><img class="post-bg" src="/img/cover/unity.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Unity2D开发记录_游戏场景搭建【1】"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/" title="Unity2D开发记录_游戏场景搭建【1】">Unity2D开发记录_游戏场景搭建【1】</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-11-09T04:49:34.000Z" title="发表于 2024-11-09 12:49:34">2024-11-09</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Unity2D/">Unity2D</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/#post-comment"><span class="waline-comment-count" data-path="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content"> 时隔一年,我又重新回到了Unity2D,但这次我是带着一个新的希望来的。在此之前我做好了充足的准备:在这里,我不会再和之前一样优哉游哉,而是把所有走过的路全都记录下来,Unity这东西,不记不用很容易生疏,当然了,更多细节这里会一笔带过,重要的会明提。 关于搭建Unity啥的就不用说了,这里直接从搭建场景开始吧…… 创建场景 完成场景搭建主要经过以下几个步骤: 下载与导入地形素材 创建Tilemap 配置Tile Palette 编辑场景 下载场景素材 可前往Unity官方商店Assets Store下载一些免费的素材 直达链接:https://assetstore.unity.com/zh-CN?category=2d&free=true&orderBy=1 1 . 找到喜欢的素材后,可以直接添加到Unity编辑器。2 . 然后在 Window > Asset store 找到并点击download来安装素材3 ....</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/" title="Electron桌面应用开发_环境搭建与应用打包"><img class="post-bg" src="/img/cover/electron.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Electron桌面应用开发_环境搭建与应用打包"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/" title="Electron桌面应用开发_环境搭建与应用打包"><i class="fas fa-thumbtack sticky"></i>Electron桌面应用开发_环境搭建与应用打包</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-10-20T01:36:01.000Z" title="发表于 2024-10-20 09:36:01">2024-10-20</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Electron/">Electron</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/#post-comment"><span class="waline-comment-count" data-path="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content"> 这是我写的一篇关于Electron的文章,这也代表着我已经开始学习桌面应用开发了。很难Electron居然是通过Html,css,js这三件套来开发应用的,想到我已经近三年没有写过web了(除了Hexo和css),没想到居然能在这应用上我最擅长的……😁😁,太幸运了。当时我学习C++的时候,一部分原因就是因为QT(我想开发桌面应用),但Electron的出现让我有了转机,我可以通过web快速的构建一个理想美观的应用程序,我一开始以为需要vue或者react,后来才知道,这两个只是Electron所支持的两个框架而已……关于这两个框架我以后再说吧…… Electron是一个使用 JavaScript、HTML 和 CSS 构建桌面应用程序的框架。 嵌入 Chromium 和 Node.js 到 二进制的 Electron 允许您保持一个 JavaScript 代码代码库并创建 在Windows上运行的跨平台应用 macOS和Linux——不需要本地开发 经验。 创建项目1 . 创建项目之前,需要先新建一个项目目录(目录名称为软件的标题名) 初始化配置文1 ....</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/" title="关于我两个箱子出金这件事"><img class="post-bg" src="https://gcore.jsdelivr.net/gh/Almango/Blog_imgbed@main/post/post_cschujin_1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="关于我两个箱子出金这件事"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/" title="关于我两个箱子出金这件事">关于我两个箱子出金这件事</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-10-17T05:31:59.000Z" title="发表于 2024-10-17 13:31:59">2024-10-17</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B8%B8%E6%88%8F/">游戏</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%B8%B8%E6%88%8F/Minecraft/">Minecraft</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/#post-comment"><span class="waline-comment-count" data-path="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">事情的起源1 . 自从买了电脑,我也是从CS起源转到了CS2了,接触的东西越来越多,特别是CS的交易系统:枪皮,刀,武器箱。看的我是真的很想要啊!2 . B站天天就给我推荐开箱出金的视频,所以……3 . 虽然概率低的可怜,仅有0.25%,但是我还是经不住诱惑,买了一个变革武器箱和两个反冲武器箱,就当做娱乐一下吧。 出金时刻 10月13日 1 . 后面我终于忍不住了,一下晚自习就向室友保证:出金请全寝吃饭。2 . 到寝室后直接往steam充了60,买了三把钥匙51块钱。3 . 我也是自己开了一个箱子,出了一个暗金的格洛克·冬季战术,0.9的磨损,磨成了垃圾,一波血亏。4 . 第二发我不敢开了,留给了室友开。5 . 正当我们全身紧绷的时候,奇迹还是发生了!!! 喜提:裹手 (★) | 钴蓝骷髅 ( 略有磨损 )6 . 看了一下磨损,马磊隔壁,0.11,靠,直接赚翻了!!!7 . 我相信,这可能会是我大学最记忆深刻的一次,那全寝撕心裂肺的叫声,就连其他寝室也闻声跑来以为是不是打架了。 </div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/" title="C++数据结构_单链表的删替插装功能实现2【7】"><img class="post-bg" src="http://testingcf.jsdelivr.net/gh/Almango/Blog_imgbed@main/post/post_cpp7_1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++数据结构_单链表的删替插装功能实现2【7】"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/" title="C++数据结构_单链表的删替插装功能实现2【7】">C++数据结构_单链表的删替插装功能实现2【7】</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-10-12T03:26:02.000Z" title="发表于 2024-10-12 11:26:02">2024-10-12</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/cpp/">cpp</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/#post-comment"><span class="waline-comment-count" data-path="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">链表的基本功能 水激石则鸣,人激志则宏。——秋瑾 1 . 基于上次写的学生管理链表,我做了一定的修改,把结构体的名称和数据域的名称修改了所以会和上次的不一样。2 . 这次我们来继续完善链表中欠缺的功能,比如:替换,插入,删除,封装等……3 .若搞不清代码,可参考上期的博客:C++数据结构_单链表的实例剖析与应用1【6】 替换函数分析1 . 替换功能还是比较简单的。 2 .开始我是想到了两种方法,一种是将整个节点替换成新的,一种是将节点的中的数据域换成新的。但目前只实践了第二种方法,个人觉得还是很直白易懂的,第一种方法也可以用,但需要先使用delete删除实例化的节点,在重新赋值, 3 . 这里说一下整个实践过程:首先是找到这个要替换的节点,可以以数据域中的某一个数据为参照物,使用while循环来查找匹配,当匹配到了,就直接给该节点的数据域赋一个新值,还有一种情况,就是当头节点就是要被替换的节点,这种就直接使用if判断一下,是则直接替换头节点的数据域。4 . 下面的图片应该会更加直白,这就相当于直接换了一个节点的数据域嘛。 代码实现与解析1 . 多说无益,直接上代码。 2...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/10/05/Cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E5%89%96%E6%9E%90%E5%BA%94%E7%94%A8/" title="C++数据结构_单链表的实例剖析与应用1【6】"><img class="post-bg" src="http://testingcf.jsdelivr.net/gh/Almango/Blog_imgbed@main/post/post_cpp6_1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++数据结构_单链表的实例剖析与应用1【6】"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/10/05/Cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E5%89%96%E6%9E%90%E5%BA%94%E7%94%A8/" title="C++数据结构_单链表的实例剖析与应用1【6】">C++数据结构_单链表的实例剖析与应用1【6】</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-10-05T04:45:21.000Z" title="发表于 2024-10-05 12:45:21">2024-10-05</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/cpp/">cpp</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/10/05/Cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E5%89%96%E6%9E%90%E5%BA%94%E7%94%A8/#post-comment"><span class="waline-comment-count" data-path="/2024/10/05/Cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E5%8D%95%E9%93%BE%E8%A1%A8%E7%9A%84%E5%89%96%E6%9E%90%E5%BA%94%E7%94%A8/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">单链表 👍要想写单链表,首先得搞明白链表的概念 链表:是一种物理存储单元上非连续、非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接次序实现的。链表由一系列结点(链表中每一个元素称为结点)组成,结点可以在运行时动态生成。每个结点包括两个部分:一个是存储数据元素的数据域,另一个是存储下一个结点地址的指针域。 相比于线性表顺序结构,操作复杂。由于不必须按顺序存储,链表在插入的时候可以达到O(1)的复杂度,比另一种线性表顺序表快得多,但是查找一个节点或者访问特定编号的节点则需要O(n)的时间,而线性表和顺序表相应的时间复杂度分别是O(logn)和O(1)。 链表节点:链表节点是链表的单元,分为头节点和子节点,头节点是链表的第一个节点,子节点是在头节点其后的节点。 上面是简易的结构图,虽然丑了些……将就看吧。 手搓一个单链表定义结构体1 . 先定义一个结构体作为链表的结构2 . 一个链表的节点被分为两个区域,一个是数据域(存放数据),一个是指针域(用于指向下一个链表节点)3 ....</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/10/03/Butterfly_%E4%B8%80%E5%9B%BE%E6%B5%81%E8%83%8C%E6%99%AF%E4%B8%8E%E9%A1%B5%E8%84%9A%E7%BE%8E%E5%8C%96/" title="Butterfly_一图流背景与页脚美化">Butterfly_一图流背景与页脚美化</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-10-03T05:20:03.000Z" title="发表于 2024-10-03 13:20:03">2024-10-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%AD%94%E6%94%B9/">魔改</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/10/03/Butterfly_%E4%B8%80%E5%9B%BE%E6%B5%81%E8%83%8C%E6%99%AF%E4%B8%8E%E9%A1%B5%E8%84%9A%E7%BE%8E%E5%8C%96/#post-comment"><span class="waline-comment-count" data-path="/2024/10/03/Butterfly_%E4%B8%80%E5%9B%BE%E6%B5%81%E8%83%8C%E6%99%AF%E4%B8%8E%E9%A1%B5%E8%84%9A%E7%BE%8E%E5%8C%96/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">一图流背景1.一图流背景简单来说就将背景作为文章的顶部封面,相当于把原有的封面去除了,这样看起来会更加清爽。2.本站参考了博主闪闪发光的 ZZZ:Hexo+Butterfly 主题一图流背景与顶部图修改 效果图: 代码1.将主题文件中的index_img:设为transparent透明。2.在background:处设置自己喜欢的背景。 12345678910# The banner image of home pageindex_img: transparent————————————————————————————————————————————# If the banner of page not setting, it will show the top_imgdefault_top_img: false # The banner image of archive pagearchive_img: false......# Website Background (設置網站背景)background: url(/img/background/g.jpg)...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/09/03/%E5%88%86%E4%BA%AB%E6%88%91%E5%9C%A8%E7%94%B5%E8%84%91%E5%86%85%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B8%8E%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/" title="分享我在电脑内的学习与开发环境"><img class="post-bg" src="/img/cover/md.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="分享我在电脑内的学习与开发环境"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/09/03/%E5%88%86%E4%BA%AB%E6%88%91%E5%9C%A8%E7%94%B5%E8%84%91%E5%86%85%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B8%8E%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/" title="分享我在电脑内的学习与开发环境">分享我在电脑内的学习与开发环境</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-09-03T06:46:51.000Z" title="发表于 2024-09-03 14:46:51">2024-09-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E6%8E%A8%E8%8D%90%E5%88%86%E4%BA%AB/">推荐分享</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/09/03/%E5%88%86%E4%BA%AB%E6%88%91%E5%9C%A8%E7%94%B5%E8%84%91%E5%86%85%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B8%8E%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/#post-comment"><span class="waline-comment-count" data-path="/2024/09/03/%E5%88%86%E4%BA%AB%E6%88%91%E5%9C%A8%E7%94%B5%E8%84%91%E5%86%85%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B8%8E%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">Google Chrome插件iTab 新标签页1 . iTab是一款免费无广告的组件式浏览器主页插件。2 . iTab 新标签页可能是我见过最美观的主导航页面了,你可以在该主页内自定义自己常用的网站快捷方式,也可以添加一些小组件,它还提供了分层页面,帮助你将主页的网站快捷方式进行分类。3 . 多的不说,iTab功能太多了,且还保持着页面的整洁。我只能说浏览器扩展的唯一真神!!! 4 . 下载链接:https://itab.link/?from=itab5 . 下载完成后,只需要将文件拖到Chrome浏览器的扩展管理页面chrome://extensions/内,并启动插件即可。 Cat-catch1 . 猫抓(cat-catch) 是一款开源的资源嗅探扩展,能够帮你筛选列出当前页面的资源。2 . 它能够将你正在访问的页面内的资源(如mp3,mp4,png,gif……等资源)抓取出来,并且可以直接下载该资源。3 . 当然了,该插件只能获取非会员的资源,毕竟非法抓取资源是需要追究侵权责任的。 4 ....</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/08/29/%E7%BB%9D%E5%8C%BA%E9%9B%B6%E5%BC%80%E6%9C%8D%E8%87%B3%E4%BB%8A%E4%BD%93%E9%AA%8C%E9%97%B2%E8%B0%88/" title="绝区零开服至今体验闲谈">绝区零开服至今体验闲谈</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-08-29T02:42:00.000Z" title="发表于 2024-08-29 10:42:00">2024-08-29</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%97%B2%E8%B0%88/">闲谈</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/08/29/%E7%BB%9D%E5%8C%BA%E9%9B%B6%E5%BC%80%E6%9C%8D%E8%87%B3%E4%BB%8A%E4%BD%93%E9%AA%8C%E9%97%B2%E8%B0%88/#post-comment"><span class="waline-comment-count" data-path="/2024/08/29/%E7%BB%9D%E5%8C%BA%E9%9B%B6%E5%BC%80%E6%9C%8D%E8%87%B3%E4%BB%8A%E4%BD%93%E9%AA%8C%E9%97%B2%E8%B0%88/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content"> ~ 欢迎来到新艾利都 ~ 1 . 说真的,这是我第一次成为米家游戏的开服玩家,虽然四年前也玩过了崩坏3,但那个时候不管怎么玩都已经落后其他玩家很大距离了,甚至还养了一堆没用的角色……。开服玩家的优势就是可以领先一些玩家一段距离,当然这也得看自身能力,或者氪金能力,所以……2 . 自从听到绝区零会在7月4日公测,其实这个时候我就已经开始放弃崩坏三了,打算把精力全都投入到绝区零当中去。 3 . 官方说是7月4日上午10点开服,但实际上为了降低崩服的风险,开服时间比预定提前了几个小时,所以当我10点多登录游戏账号的时候,我的UID已经到达八位数了(UID:18450689),也能理解,毕竟是个万众瞩目的游戏。 4 . 这里要说的是,入坑绝区零的首要因素是:这款游戏的画面风格我很喜欢,现代风,赛博风,同时参入了日美元素。这相对于原神那种玄幻风格的简直不要太棒。 游戏体验剧情1 . 开服到现在差不多玩了一个月1了,就这么说吧,游戏不论是场景细节还是打斗特效以及人物刻画都是十分细节精湛,很可惜我的不是电脑,如果是高配电脑的话,画面会更加高清细节,手机的话勉勉强强。2 ....</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2024/08/21/cpp%E7%BB%93%E6%9E%84%E4%BD%93%E7%9A%84%E7%94%A8%E6%B3%95%E6%B5%85%E6%9E%90/" title="C++结构体的用法浅析【5】"><img class="post-bg" src="/img/cover/cpp.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++结构体的用法浅析【5】"></a></div><div class="recent-post-info"><a class="article-title" href="/2024/08/21/cpp%E7%BB%93%E6%9E%84%E4%BD%93%E7%9A%84%E7%94%A8%E6%B3%95%E6%B5%85%E6%9E%90/" title="C++结构体的用法浅析【5】">C++结构体的用法浅析【5】</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-08-21T03:27:20.000Z" title="发表于 2024-08-21 11:27:20">2024-08-21</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a><i class="fas fa-angle-right article-meta-link"></i><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/cpp/">cpp</a></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-comments"></i><a href="/2024/08/21/cpp%E7%BB%93%E6%9E%84%E4%BD%93%E7%9A%84%E7%94%A8%E6%B3%95%E6%B5%85%E6%9E%90/#post-comment"><span class="waline-comment-count" data-path="/2024/08/21/cpp%E7%BB%93%E6%9E%84%E4%BD%93%E7%9A%84%E7%94%A8%E6%B3%95%E6%B5%85%E6%9E%90/"><i class="fa-solid fa-spinner fa-spin"></i></span></a><span class="article-meta-label"> 条评论</span></span></div><div class="content"> C++中的结构体还是挺有必要记录一下,写个笔记的。它和类十分的相似,所以在这里需要做个具体的区分。结构体和类最大的区别就是:结构体的成员默认是完全公开public的,而类则默认是私有`private的。 结构体1 . C++中的结构体(Struct)是一种数据结构,可以将创建好的结构体作为一个新的数据类型来使用。 2 . 结构体是一个单一名称下不同数据类型的变量的集合。它与类相似,两者都保存着不同数据类型的数据集合。3 . 通常情况下,当我们想多个同一属性的变量,在不使用类和结构体的情况下,我们需要声明多个变量来实现这些属性,而为解决这一不优雅的操作,结构体应运而生,它运允许在一个结构体内定义多个属性, 且将不同类型的数据项组合成一个单一的实体。结构体通常用于将数据分组,以便可以轻松地作为一个单元来处理它们。 语法1234struct [structName]{ member-list}...</div></div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">…</span><a class="page-number" href="/page/8/#content-inner">8</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info text-center"><div class="avatar-img"><img src="/img/Head.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info-name">Almango</div><div class="author-info-description">天真永不消逝,浪漫至死不渝</div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">80</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">51</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">29</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Almango"><i class="iconfont icon-github"></i><span>戳一下</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">人生不相见,动如参与商。</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/" title="我的世界Java版本搭建本地服务器:实现开服与联机自由"><img src="https://www.minecraft.net/content/dam/minecraftnet/games/minecraft/screenshots/EXPLORE_PDPScreenshotRefresh2024_multipleBiomes_01.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="我的世界Java版本搭建本地服务器:实现开服与联机自由"/></a><div class="content"><a class="title" href="/2024/11/15/Minecraft%E6%90%AD%E5%BB%BA%E6%9C%AC%E5%9C%B0%E6%9C%8D%E5%8A%A1%E5%99%A8_%E5%AE%9E%E7%8E%B0%E5%A4%9A%E4%BA%BA%E8%81%94%E6%9C%BA%E8%87%AA%E7%94%B1/" title="我的世界Java版本搭建本地服务器:实现开服与联机自由">我的世界Java版本搭建本地服务器:实现开服与联机自由</a><time datetime="2024-11-15T06:34:01.000Z" title="发表于 2024-11-15 14:34:01">2024-11-15</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/" title="Unity2D开发记录_游戏场景搭建【1】"><img src="/img/cover/unity.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Unity2D开发记录_游戏场景搭建【1】"/></a><div class="content"><a class="title" href="/2024/11/09/Unity2D%E5%BC%80%E5%8F%91%E8%AE%B0%E5%BD%95_%E6%B8%B8%E6%88%8F%E5%9C%BA%E6%99%AF%E6%90%AD%E5%BB%BA%E3%80%901%E3%80%91/" title="Unity2D开发记录_游戏场景搭建【1】">Unity2D开发记录_游戏场景搭建【1】</a><time datetime="2024-11-09T04:49:34.000Z" title="发表于 2024-11-09 12:49:34">2024-11-09</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/" title="Electron桌面应用开发_环境搭建与应用打包"><img src="/img/cover/electron.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Electron桌面应用开发_环境搭建与应用打包"/></a><div class="content"><a class="title" href="/2024/10/20/Electron%E6%A1%8C%E9%9D%A2%E5%BC%80%E5%8F%91_%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA%E4%B8%8E%E6%89%93%E5%8C%85/" title="Electron桌面应用开发_环境搭建与应用打包">Electron桌面应用开发_环境搭建与应用打包</a><time datetime="2024-10-20T01:36:01.000Z" title="发表于 2024-10-20 09:36:01">2024-10-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/" title="关于我两个箱子出金这件事"><img src="https://gcore.jsdelivr.net/gh/Almango/Blog_imgbed@main/post/post_cschujin_1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="关于我两个箱子出金这件事"/></a><div class="content"><a class="title" href="/2024/10/17/%E5%85%B3%E4%BA%8E%E6%88%91%E4%B8%A4%E4%B8%AA%E7%AE%B1%E5%AD%90%E5%87%BA%E9%87%91%E8%BF%99%E4%BB%B6%E4%BA%8B/" title="关于我两个箱子出金这件事">关于我两个箱子出金这件事</a><time datetime="2024-10-17T05:31:59.000Z" title="发表于 2024-10-17 13:31:59">2024-10-17</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/" title="C++数据结构_单链表的删替插装功能实现2【7】"><img src="http://testingcf.jsdelivr.net/gh/Almango/Blog_imgbed@main/post/post_cpp7_1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="C++数据结构_单链表的删替插装功能实现2【7】"/></a><div class="content"><a class="title" href="/2024/10/12/cpp%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84_%E9%93%BE%E8%A1%A8%E7%9A%84%E5%88%A0%E6%9B%BF%E6%8F%92%E8%A3%85%E5%8A%9F%E8%83%BD%E5%AE%9E%E7%8E%B02/" title="C++数据结构_单链表的删替插装功能实现2【7】">C++数据结构_单链表的删替插装功能实现2【7】</a><time datetime="2024-10-12T03:26:02.000Z" title="发表于 2024-10-12 11:26:02">2024-10-12</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>最新评论</span></div><div class="aside-list"><span>加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
<a class="card-more-btn" href="/categories/" title="查看更多">
<i class="fas fa-angle-right"></i></a>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/C/"><span class="card-category-list-name">C#</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Git/"><span class="card-category-list-name">Git</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Hexo/"><span class="card-category-list-name">Hexo</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/IDE/"><span class="card-category-list-name">IDE</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%90%8D%E4%BA%BA%E4%BC%A0/"><span class="card-category-list-name">名人传</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%9B%BE%E5%BA%8A/"><span class="card-category-list-name">图床</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%AD%A6%E4%B9%A0%E4%B8%8E%E6%88%90%E9%95%BF/"><span class="card-category-list-name">学习与成长</span><span class="card-category-list-count">2</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/Hexo/" style="font-size: 1.33em; color: #99a2af">Hexo</a> <a href="/tags/Butterfly/" style="font-size: 1.1em; color: #999">Butterfly</a> <a href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/" style="font-size: 1.21em; color: #999ea4">操作系统</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E7%88%AC%E8%99%AB/" style="font-size: 1.39em; color: #99a4b4">网络爬虫</a> <a href="/tags/CSGO/" style="font-size: 1.1em; color: #999">CSGO</a> <a href="/tags/%E7%BA%AA%E5%BF%B5%E6%97%A5/" style="font-size: 1.1em; color: #999">纪念日</a> <a href="/tags/Adobe-Photoshop/" style="font-size: 1.1em; color: #999">Adobe Photoshop</a> <a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 1.1em; color: #999">算法</a> <a href="/tags/Algo/" style="font-size: 1.1em; color: #999">Algo</a> <a href="/tags/NET/" style="font-size: 1.5em; color: #99a9bf">.NET</a> <a href="/tags/Python/" style="font-size: 1.44em; color: #99a7ba">Python</a> <a href="/tags/%E5%AD%97%E4%BD%93/" style="font-size: 1.1em; color: #999">字体</a> <a href="/tags/Git/" style="font-size: 1.1em; color: #999">Git</a> <a href="/tags/%E9%9D%A2%E5%90%91%E8%BF%87%E7%A8%8B/" style="font-size: 1.1em; color: #999">面向过程</a> <a href="/tags/%E5%90%8D%E4%BA%BA%E4%BA%8B%E8%BF%B9/" style="font-size: 1.1em; color: #999">名人事迹</a> <a href="/tags/Unity/" style="font-size: 1.1em; color: #999">Unity</a> <a href="/tags/%E7%BE%8E%E5%8C%96/" style="font-size: 1.16em; color: #999b9e">美化</a> <a href="/tags/HarmonyOS/" style="font-size: 1.1em; color: #999">HarmonyOS</a> <a href="/tags/ts/" style="font-size: 1.16em; color: #999b9e">ts</a> <a href="/tags/%E5%8A%A8%E6%BC%AB/" style="font-size: 1.1em; color: #999">动漫</a> <a href="/tags/%E5%BC%80%E6%BA%90/" style="font-size: 1.16em; color: #999b9e">开源</a> <a href="/tags/FydeOS/" style="font-size: 1.1em; color: #999">FydeOS</a> <a href="/tags/Linux/" style="font-size: 1.21em; color: #999ea4">Linux</a> <a href="/tags/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1/" style="font-size: 1.1em; color: #999">面向对象</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" style="font-size: 1.27em; color: #99a0a9">网络编程</a> <a href="/tags/MC/" style="font-size: 1.1em; color: #999">MC</a> <a href="/tags/C/" style="font-size: 1.27em; color: #99a0a9">C</a> <a href="/tags/%E7%B1%B3%E5%93%88%E6%B8%B8/" style="font-size: 1.1em; color: #999">米哈游</a> <a href="/tags/DIY/" style="font-size: 1.21em; color: #999ea4">DIY</a> <a href="/tags/%E5%AD%A6%E4%B9%A0%E4%B8%8E%E6%88%90%E9%95%BF/" style="font-size: 1.1em; color: #999">学习与成长</a> <a href="/tags/Unity2D/" style="font-size: 1.1em; color: #999">Unity2D</a> <a href="/tags/Adobe-Creative-Cloud/" style="font-size: 1.1em; color: #999">Adobe Creative Cloud</a> <a href="/tags/%E6%97%A5%E8%AE%B0/" style="font-size: 1.1em; color: #999">日记</a> <a href="/tags/MinGW/" style="font-size: 1.27em; color: #99a0a9">MinGW</a> <a href="/tags/2023/" style="font-size: 1.1em; color: #999">2023</a> <a href="/tags/%E4%BD%A0%E7%9A%84%E5%90%8D%E5%AD%97/" style="font-size: 1.1em; color: #999">你的名字</a> <a href="/tags/%E5%BC%80%E6%9C%8D/" style="font-size: 1.1em; color: #999">开服</a> <a href="/tags/Blog/" style="font-size: 1.1em; color: #999">Blog</a> <a href="/tags/Office365/" style="font-size: 1.1em; color: #999">Office365</a> <a href="/tags/%E7%BB%9D%E5%8C%BA%E9%9B%B6/" style="font-size: 1.1em; color: #999">绝区零</a></div></div><div class="card-widget card-archives">
<div class="item-headline">
<i class="fas fa-archive"></i>
<span>归档</span>
<a class="card-more-btn" href="/archives/" title="查看更多"><i class="fas fa-angle-right"></i></a>
</div>
<ul class="card-archive-list">
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/11/">
<span class="card-archive-list-date">十一月 2024</span>
<span class="card-archive-list-count">2</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/10/">
<span class="card-archive-list-date">十月 2024</span>
<span class="card-archive-list-count">5</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/09/">
<span class="card-archive-list-date">九月 2024</span>
<span class="card-archive-list-count">1</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/08/">
<span class="card-archive-list-date">八月 2024</span>
<span class="card-archive-list-count">11</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/07/">
<span class="card-archive-list-date">七月 2024</span>
<span class="card-archive-list-count">14</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/06/">
<span class="card-archive-list-date">六月 2024</span>
<span class="card-archive-list-count">5</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/05/">
<span class="card-archive-list-date">五月 2024</span>
<span class="card-archive-list-count">5</span>
</a>
</li>
<li class="card-archive-list-item">
<a class="card-archive-list-link" href="/archives/2024/04/">
<span class="card-archive-list-date">四月 2024</span>
<span class="card-archive-list-count">4</span>
</a>
</li>
</ul></div></div></div></main><footer id="footer"><div id="footer-wrap"><div id="footer-left"><div class="footer-title"><span>Almango | </span><span class="footer-copyright">©2023 - 2024 By Almango</span></div><div class="footer-button"><a title="GitHub" target="_blank" rel="noopener" href="https://github.com/Almango"><i class="fab fa-github"></i></a><a title="微博" target="_blank" rel="noopener" href="https://weibo.com/u/7936064867"><i class="fab fa-weibo"></i></a><a title="bilibili" target="_blank" rel="noopener" href="https://space.bilibili.com/1278951656?spm_id_from=333.1007.0.0"><i class="fab fa-bilibili"></i></a><a title="twitterb" target="_blank" rel="noopener" href="https://twitter.com/Receiver99xkk?t=UoMBRIY0a-csS_gUb9aIRg&s=09"><i class="fa-brands fa-x-twitter"></i></a><a title="Email" target="_blank" rel="noopener" href="https://www.microsoft.com/zh-cn/microsoft-365/outlook/email-and-calendar-software-microsoft-outlook?deeplink=%2fowa%2f0%2f%3fstate%3d1%26redirectTo%3daHR0cHM6Ly9vdXRsb29rLmxpdmUuY29tL21haWwvMC8&sdf=0"><i class="fa-solid fa-envelope"></i></a></div><div class="wordcount"></div><span>Almano已经写了 98k 字,</span><span>好像写完一本 林海音 的 《城南旧事》 了啊</span></div><div id="footer-right"><div class="footer-totop"><i class="fas fa-chevron-up" onclick="scrollToTop()"></i></div><div class="footer-info"><p>使用Hexo框架 | 本站基于butterfly主题魔改</p><a title="萌ICP备号 20240146" target="_blank" rel="noopener" href="https://icp.gov.moe/?keyword=20240146"><img src="/img/footer_moe.png" alt="备案图标" style="height: 16px;margin-right: 3px;filter: grayscale(1);"/>萌ICP备号: 20240146号</a><a title="喵喵ICP备案: 20240008号" href="https://www.nyaicp.xyz/?id=20240008" target="_blank"">喵喵ICP备案: 20240008号</a></div><div class="footer-service"><a title="腾讯云" target="_blank" rel="noopener" href="https://cloud.tencent.com"><img alt="腾讯云" src="https://cdn.ichika.cc/typora/202211071552681.png!towebp"/></a><a title="51LA" target="_blank" rel="noopener" href="https://www.51.la"><img alt="51LA" src="https://cdn.ichika.cc/typora/202211071552427.png!towebp"/></a><a title="CC BY-NC-SA 4.0" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"><img alt="CC BY-NC-SA 4.0" src="https://cdn.ichika.cc/typora/202211071552856.png!towebp"/></a></div></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>(() => {
async function loadWaline () {
try {
const eleGroup = document.querySelectorAll('#recent-posts .waline-comment-count')
const keyArray = Array.from(eleGroup).map(i => i.getAttribute('data-path'))
const res = await fetch(`https://www.almango.top/api/comment?type=count&url=${keyArray}`, { method: 'GET' })
const result = await res.json()
result.data.forEach((count, index) => {
eleGroup[index].textContent = count
})
} catch (err) {
console.error(err)
}
}
window.pjax ? loadWaline() : window.addEventListener('load', loadWaline)
})()</script><script>window.typedJSFn = {
init: str => {
window.typed = new Typed('#subtitle', Object.assign({
strings: str,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
}, null))
},
run: subtitleType => {
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
btf.getScript('https://cdn.jsdelivr.net/npm/typed.js/dist/typed.umd.min.js').then(subtitleType)
}
} else {
subtitleType()
}
}
}
btf.addGlobalFn('pjaxSendOnce', () => { typed.destroy() }, 'typedDestroy')
</script><script>function subtitleType () {
if (true) {
typedJSFn.init(["Hello I'm Almango. Welcome to my blog👋👋。","天真永不消逝,浪漫至死不渝。","白云升远岫,摇曳入晴空。","芸芸众生,孰不爱生?爱生之极,进而爱群。","Quitters never win and winners never quit."])
} else {
document.getElementById("subtitle").textContent = "Hello I'm Almango. Welcome to my blog👋👋。"
}
}
typedJSFn.run(subtitleType)</script></div><script>window.newestComments = {
changeContent: content => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
content = content.replace(/<code>.*?<\/code>/gi, '[代码]') // replace code
content = content.replace(/<[^>]+>/g, "") // remove html tag
if (content.length > 150) {
content = content.substring(0, 150) + '...'
}
return content
},
generateHtml: (array, ele) => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class="aside-list-item">'
if (true && array[i].avatar) {
const imgAttr = 'src'
result += `<a href="${array[i].url}" class="thumbnail"><img ${imgAttr}="${array[i].avatar}" alt="${array[i].nick}"></a>`
}
result += `<div class="content">
<a class="comment" href="${array[i].url}" title="${array[i].content}">${array[i].content}</a>
<div class="name"><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
} else {
result += '暂无评论'
}
ele.innerHTML = result
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh(ele)
},
newestCommentInit: (name, getComment) => {
const $dom = document.querySelector('#card-newest-comments .aside-list')
if ($dom) {
const data = btf.saveToLocal.get(name)
if (data) {
newestComments.generateHtml(JSON.parse(data), $dom)
} else {
getComment($dom)
}
}
},
run: (name, getComment) => {
newestComments.newestCommentInit(name, getComment)
btf.addGlobalFn('pjaxComplete', () => newestComments.newestCommentInit(name, getComment), name)
}
}</script><script>window.addEventListener('load', () => {
const keyName = 'waline-newest-comments'
const { changeContent, generateHtml, run } = window.newestComments
const getComment = async (ele) => {
try {
const res = await fetch('https://www.almango.top/api/comment?type=recent&count=6', { method: 'GET' })
const result = await res.json()
const walineArray = result.data.map(e => {
return {
'content': changeContent(e.comment),
'avatar': e.avatar,
'nick': e.nick,
'url': e.url + '#' + e.objectId,
'date': e.time || e.insertedAt
}
})
btf.saveToLocal.set(keyName, JSON.stringify(walineArray), 10/(60*24))
generateHtml(walineArray, ele)
} catch (err) {
console.error(err)
ele.textContent= "无法获取评论,请确认相关配置是否正确"
}
}
run(keyName, getComment)
})</script><script src="/live2d-widget/autoload.js"></script><script src="/js/custom.js"></script><script src="/js/fps.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="text-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><!-- hexo injector body_end start --><script data-pjax>
function butterfly_footer_beautify_injector_config(){
var parent_div_git = document.getElementById('footer-wrap');
var item_html = '<p id="ghbdages"><a class="github-badge" target="_blank" href="https://hexo.io/" style="margin-inline:5px" data-title="博客框架为Hexo_v5.4.0" title=""><img src="https://img.shields.io/badge/Frame-Hexo-blue?style=flat&logo=hexo" alt=""/></a><a class="github-badge" target="_blank" href="https://butterfly.js.org/" style="margin-inline:5px" data-title="主题版本Butterfly_v3.8.2" title=""><img src="https://img.shields.io/badge/Theme-Butterfly-6513df?style=flat&logo=bitdefender" alt=""/></a><a class="github-badge" target="_blank" href="https://www.jsdelivr.com/" style="margin-inline:5px" data-title="本站使用JsDelivr为静态资源提供CDN加速" title=""><img src="https://img.shields.io/badge/CDN-jsDelivr-orange?style=flat&logo=jsDelivr" alt=""/></a><a class="github-badge" target="_blank" href="https://vercel.com/" style="margin-inline:5px" data-title="本站采用双线部署,默认线路托管于Vercel" title=""><img src="https://img.shields.io/badge/Hosted-Vercel-brightgreen?style=flat&logo=Vercel" alt=""/></a><a class="github-badge" target="_blank" href="https://vercel.com/" style="margin-inline:5px" data-title="本站采用双线部署,联通线路托管于Coding" title=""><img src="https://img.shields.io/badge/Hosted-Coding-0cedbe?style=flat&logo=Codio" alt=""/></a><a class="github-badge" target="_blank" href="https://github.com/" style="margin-inline:5px" data-title="本站项目由Github托管" title=""><img src="https://img.shields.io/badge/Source-Github-d021d6?style=flat&logo=GitHub" alt=""/></a><a class="github-badge" target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" style="margin-inline:5px" data-title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可" title=""><img src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=flat&logo=Claris" alt=""/></a><a class="github-badge" target="_blank" href="https://icp.gov.moe/?keyword=20240146" style="margin-inline:5px" data-title="萌ICP备 纯属萌友网站联萌!" title=""><img src="https://img.shields.io/badge/%E8%90%8CICP%E5%A4%87-20240146-fe1384?style-flat&logo=data:image/png;base64,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" alt=""/></a></p>';
console.log('已挂载butterfly_footer_beautify')
parent_div_git.insertAdjacentHTML("beforeend",item_html)
}
var elist = 'null'.split(',');
var cpage = location.pathname;
var epage = 'all';
var flag = 0;
for (var i=0;i<elist.length;i++){
if (cpage.includes(elist[i])){
flag++;
}
}
if ((epage ==='all')&&(flag == 0)){
butterfly_footer_beautify_injector_config();
}
else if (epage === cpage){
butterfly_footer_beautify_injector_config();
}
</script><!-- hexo injector body_end end --></body></html>