Comments (8)
Understood! Thanks for sharing
from demoinfocs-golang.
Out of curiosity, is there any reason you dont do it like this?
var mapCodes = map[string]uint32{
"de_mirage": 1936772555,
"de_anubis": 3934213780,
"de_nuke": 4081488007,
"de_inferno": 3201302029,
"de_ancient": 4262714479,
"de_overpass": 2863184063,
"de_vertigo": 970160341,
}
var mapMetadata ex.Map
p.RegisterNetMessageHandler(func(msg *msgs2.CSVCMsg_ServerInfo) {
mapName := msg.GetMapName() // change if you want mapName to be available somewhere else as well
mapMetadata = ex.GetMapMetadata(mapName, mapCodes[mapName])
})
from demoinfocs-golang.
Yes, because I forgot that Key-Value dictionaries exists XD
from demoinfocs-golang.
@NintyS were you ever able to figure out?
from demoinfocs-golang.
Nah, probably you can't. But I get from CS:GO the CRC codes and they works so for now I'm good.
var (
Mirage uint32 = 1936772555
Anubis uint32 = 3934213780
Nuke uint32 = 4081488007
Inferno uint32 = 3201302029
Ancient uint32 = 4262714479
Overpass uint32 = 2863184063
Vertigo uint32 = 970160341
)
from demoinfocs-golang.
Understood! Thanks for the list. However, how do you get the map name from the demo to get the corresponding crc? header.MapName
returning nil
for me.
from demoinfocs-golang.
Sorry for delay, I didn't get notification until I open mail. AFAIK header is deprecated / returns nothing because new header is different than old one.
This is my code:
`
var mapName string
var mapMetaData ex.Map
p.RegisterNetMessageHandler(func(msg *msgs2.CSVCMsg_ServerInfo) {
var mapCode uint32 = 0
if strings.Contains(msg.GetMapName(), "mirage") {
mapCode = Mirage
}
if strings.Contains(msg.GetMapName(), "overpass") {
mapCode = Overpass
}
if strings.Contains(msg.GetMapName(), "inferno") {
mapCode = Inferno
}
if strings.Contains(msg.GetMapName(), "vertigo") {
mapCode = Vertigo
}
if strings.Contains(msg.GetMapName(), "anubis") {
mapCode = Anubis
}
if strings.Contains(msg.GetMapName(), "nuke") {
mapCode = Nuke
}
if strings.Contains(msg.GetMapName(), "ancient") {
mapCode = Ancient
}
mapMetaData = ex.GetMapMetadata(msg.GetMapName(), mapCode)
fmt.Println(mapMetaData)
mapName = msg.GetMapName()
})`
from demoinfocs-golang.
It's shit but for now this is only thing I can do I guess. Maybe I will post my repo with code as a example for people.
from demoinfocs-golang.
Related Issues (20)
- Nil property leading to panic HOT 6
- EOF: demo stream ended unexpectedly (ErrUnexpectedEndOfDemo) HOT 1
- [CS2] Inferno.Fires().ConvexHull2D() throwing "panic: property 'm_fireXDelta.0000' not found" HOT 1
- Empty Demo Header HOT 1
- Question: how to get time elapsed since round start? HOT 1
- Player equipment incorrect HOT 13
- Source 2: when I call inferno.Fires(), i get the exception : "property 'm_fireXDelta.0000' not found" HOT 5
- Broken after last update, missing e.Killer/e.Victim for events.Kill HOT 1
- How to uniquely identify demo? HOT 2
- Parser fails on v4.0.0 instantly due to interface conversion error around bindPlayerWeaponsS2 HOT 8
- Player vanishes from connected players list, but continues to be active in the game. HOT 3
- Player equipment incorrect HOT 6
- Missing - Unknown granade model HOT 1
- There is no kill events on Esportal demos but kills are there when demo is played with the game HOT 3
- interface conversion: interface {} is *sendtables2.fieldState, not uint64 HOT 1
- Missing player in TeamState.Members() HOT 6
- No ItemDrop events fround from CS2 demos HOT 2
- Players are assigned to the wrong teams HOT 13
- Events are not firing in CS2 GOTV demo HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from demoinfocs-golang.