走過去的部落格

瞎写现代诗

伟大目标

直接给我钱,
加一。
教我去工作,
加一。
要了我的命,
加一。
(2019年1月10日)

爱情

这种特殊待遇,
不是那么好得来的。
尤其是,
你离我离得远远的时候。
(2019年1月15日)

我的起源开发笔记

其实是方便我自己复制粘贴用的(((
各位如果有需要就请自便吧

VMT 语句:

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
UnLitGeneric
VertexlitGeneric
LightmappedGeneric

$basetexture "aaa/bbb"

$surfaceprop brick
$surfaceprop metal
$surfaceprop wood
$surfaceprop grass
$surfaceprop flesh
$surfaceprop rubber

$bumpmap

$alphatest 1

$halflambert 1

$translucent 1

$nocull 1

$decal 1
$decalscale 0.25

$nodecal 1

$phong 1
$phongboost 1
$PhongFresnelRanges "[0 0.5 1]"
$PhongExponent 5
$lightwarptexture "models/xxx/shader"

$rimlight 1
$rimlightexponent 2
$rimlightboost .2

Proxies
{
AnimatedTexture
{
animatedtexturevar $basetexture
animatedtextureframenumvar $frame
animatedtextureframerate 25
}
}

//随机贴图 https://steamcommunity.com/sharedfiles/filedetails/?id=668958242
Proxies
{
EntityRandom
{
scale 27.99 //这里写动态贴图的帧数减去0.01
resultVar $frame
}
}

QC 语句:

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
$texturegroup a
{
{ "r1" }
{ "r2" }
}

$bodygroup glasses
{
studio "glasses1.smd"
blank
}

$modelname "prop_test.mdl"
$scale 1.0
$BodyGroup "body"
{
studio "r.smd"
}
$staticprop
$surfaceprop wood
$cdmaterials "models/mytextures"
$sequence idle "r.smd"
$collisionmodel "phy.smd"
{
$mass 10
$concave
}

$IncludeModel "humans/male_shared.mdl"
$IncludeModel "humans/male_ss.mdl"
$IncludeModel "humans/male_gestures.mdl"
$IncludeModel "humans/male_postures.mdl"

$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_ss.mdl"
$includemodel "humans/female_gestures.mdl"
$includemodel "humans/female_postures.mdl"

$IncludeModel "m_anm.mdl"
$includemodel "f_anm.mdl"

$IncludeModel "combine_soldier_anims.mdl"

//油桶爆炸 models/props_c17/oildrum001_explosive.mdl
$CollisionText
{
break
{
"model" "props_c17/oildrumchunk01a"
"health" "10"
"fadetime" "10"
"burst" "100"
}
break
{
"model" "props_c17/oildrumchunk01b"
"health" "10"
"fadetime" "10"
"burst" "100"
}
break
{
"model" "props_c17/oildrumchunk01c"
"health" "10"
"fadetime" "10"
"burst" "100"
}
break
{
"model" "props_c17/oildrumchunk01d"
"health" "10"
"fadetime" "10"
"burst" "100"
}
break
{
"model" "props_c17/oildrumchunk01e"
"health" "10"
"fadetime" "10"
"burst" "100"
}
$KeyValues
{
prop_data
{
"dmg.bullets" "1.0"
"dmg.club" "1.0"
"dmg.explosive" "1.0"
"health" "20"
"explosive_damage" "120"
"explosive_radius" "256"
}
physgun_interactions
{
"onfirstimpact" "break"
}
fire_interactions
{
"flammable" "yes"
"explosive_resist" "yes"
"ignite" "halfhealth"
}
}
}

求生之路对应人物模型:

1
2
3
4
5
6
7
8
Ellis    survivor_mechanic
Nick survivor_gambler
Coach survivor_coach
Rochelle survivor_producer
Bill survivor_namvet
Francis survivor_biker
Zoey survivor_teenangst
Louis survivor_manager

玩家模型、NPC的GMOD LUA:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local Category = "cha"
player_manager.AddValidModel( Category , "models/cha/pm.mdl" )
player_manager.AddValidHands( Category , "models/weapons/c_arms_citizen.mdl", 0, "0000000" )
list.Set( "PlayerOptionsModel", Category , "" )

local NPC = {
Name = "Good Cha",
Class = "npc_citizen",
Weapons = { "weapon_smg1", "weapon_ar2" },
Model = "models/cha/citizen.mdl",
Category = Category ,
KeyValues = { citizentype = 4 },
}
list.Set( "NPC", "npc_" .. Category .. "1", NPC )

local NPC = {
Name = "Bad cha",
Class = "npc_combine_s",
Weapons = { "weapon_smg1", "weapon_ar2" },
Model = "models/cha/combine.mdl",
Category = Category ,
KeyValues = { SquadName = "overwatch", Numgrenades = 5 }
}
list.Set( "NPC", "npc_" .. Category .. "2", NPC )

.NET HttpListener 监听局域网其他设备HTTP请求的说明

我一直在想怎么在局域网内其他设备(手机、电脑)给自己的电脑传输HTTP请求,并且要用 .NET 的 HttpListener 监听到。然后今天终于试出来了,而且和 Windows 防火墙有离不开的关系,我说我以前怎么怎么测试都不行呢。

首先要开一个线程是肯定要的,然后大概是这样

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Dim h As New HttpListener, bs() As Byte, s As String
h.AuthenticationSchemes = AuthenticationSchemes.Anonymous
Dim port As String = CStr(8900)
h.Prefixes.Add("http://localhost:" + port + "/") '只对本机起作用
h.Prefixes.Add("http://192.168.1.10:" + port + "/") '可以手动获得本机IP然后作为符串填在这里
h.Prefixes.Add("http://*:" + port + "/") '不管前面是什么,后面port对应就会监到
h.Prefixes.Add("http://+:" + port + "/") '同上
h.Start()
Do While True
Dim c As HttpListenerContext = h.GetContext
Dim RQ As HttpListenerRequest = c.Request
Dim RS As HttpListenerResponse = c.Response
s = Now & vbCrLf & 随机.数字() '随便写点东西发过去
bs = 文字转字节(s)
Dp(RQ.Url.ToString, RQ.UserAgent)
RS.OutputStream.Write(bs, 0, bs.Length)
RS.Close()
Loop

所以我们现在可以用这些链接访问我们的 HttpListener 了。

1
2
3
4
http://192.168.1.10:8989/
http://localhost:8989/
http://127.0.0.1:8989/
后两个链接只有本机可以访问

接下来,如果你开着 Windows 防火墙,那么基本上只有你自己这台电脑可以靠访问这个链接。
怎么办呢?而且需要管理员权限才能实时创建监听。
我们得管理员运行下面 CMD 指令:

1
2
3
netsh http add urlacl url=http://localhost:8900/ user=Everyone
netsh http add urlacl url=http://+:8900/ user=Everyone
netsh http add urlacl url=http://*:8900/ user=Everyone

这里添加到系统保留URL之后,就可以免管理员权限监听了。不会返回:拒绝访问。
然后新增防火墙规则:

1
netsh advfirewall firewall Add rule name="over 8900" dir=in protocol=tcp localport=8900 action=allow

完成之后就可以在局域网内的其他设备里访问了:

真爽!