Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
b11009f7
Commit
b11009f7
authored
Apr 23, 2022
by
Yazawazi
Committed by
GitHub
Apr 23, 2022
Browse files
Merge branch 'Grasscutters:development' into development
parents
7ccecda0
b98860c4
Changes
26
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/inventory/GenshinItem.java
View file @
b11009f7
...
...
@@ -34,7 +34,7 @@ import emu.grasscutter.net.proto.SceneWeaponInfoOuterClass.SceneWeaponInfo;
import
emu.grasscutter.net.proto.WeaponOuterClass.Weapon
;
import
emu.grasscutter.utils.WeightedList
;
@Entity
(
value
=
"items"
,
noClassnameS
tor
ed
=
tru
e
)
@Entity
(
value
=
"items"
,
useDiscrimina
tor
=
fals
e
)
public
class
GenshinItem
{
@Id
private
ObjectId
id
;
@Indexed
private
int
ownerId
;
...
...
src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java
View file @
b11009f7
...
...
@@ -101,14 +101,14 @@ public final class DispatchServer {
.
setName
(
"os_usa"
)
.
setTitle
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Name
)
.
setType
(
"DEV_PUBLIC"
)
.
setDispatchUrl
(
"http"
+
(
Grasscutter
.
getConfig
().
getDispatchOptions
().
FrontHTTPS
?
"s"
:
""
)
+
"://"
+
(
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getDispatchOptions
().
Ip
:
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicIp
)
+
":"
+
getAddress
().
getPort
(
)
+
"/query_cur_region_"
+
defaultServerName
)
.
setDispatchUrl
(
"http"
+
(
Grasscutter
.
getConfig
().
getDispatchOptions
().
FrontHTTPS
?
"s"
:
""
)
+
"://"
+
(
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getDispatchOptions
().
Ip
:
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicIp
)
+
":"
+
(
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getDispatchOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getDispatchOptions
().
Port
)
+
"/query_cur_region_"
+
defaultServerName
)
.
build
();
usedNames
.
add
(
defaultServerName
);
servers
.
add
(
server
);
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
...
...
src/main/java/emu/grasscutter/server/packet/send/PacketPlayerLoginRsp.java
View file @
b11009f7
...
...
@@ -41,7 +41,7 @@ public class PacketPlayerLoginRsp extends GenshinPacket {
RegionInfo
serverRegion
=
regionQuery
.
getRegionInfo
().
toBuilder
()
.
setIp
((
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
.
isEmpty
()
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
Ip
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicIp
))
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setPort
(
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
!=
0
?
Grasscutter
.
getConfig
().
getGameServerOptions
().
PublicPort
:
Grasscutter
.
getConfig
().
getGameServerOptions
().
Port
)
.
setSecretKey
(
ByteString
.
copyFrom
(
FileUtils
.
read
(
Grasscutter
.
getConfig
().
KEY_FOLDER
+
"dispatchSeed.bin"
)))
.
build
();
...
...
src/main/java/emu/grasscutter/tools/Tools.java
View file @
b11009f7
package
emu.grasscutter.tools
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.InputStreamReader
;
import
java.io.OutputStreamWriter
;
import
java.io.PrintWriter
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
...
...
@@ -30,13 +35,13 @@ public final class Tools {
ResourceLoader
.
loadResources
();
Map
<
Long
,
String
>
map
;
try
(
File
Reader
fileReader
=
new
FileReader
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
)))
{
try
(
InputStream
Reader
fileReader
=
new
InputStreamReader
(
new
FileInputStream
(
Utils
.
toFilePath
(
Grasscutter
.
getConfig
().
RESOURCE_FOLDER
+
"TextMap/TextMapEN.json"
))
,
StandardCharsets
.
UTF_8
)
)
{
map
=
Grasscutter
.
getGsonFactory
().
fromJson
(
fileReader
,
new
TypeToken
<
Map
<
Long
,
String
>>()
{}.
getType
());
}
List
<
Integer
>
list
;
String
fileName
=
"./GM Handbook.txt"
;
try
(
File
Writer
fileW
riter
=
new
File
Writer
(
fileName
);
PrintWriter
w
riter
=
new
PrintWriter
(
fileWriter
))
{
try
(
Print
Writer
w
riter
=
new
Print
Writer
(
new
OutputStreamW
riter
(
new
FileOutputStream
(
fileName
),
StandardCharsets
.
UTF_8
),
false
))
{
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy/MM/dd HH:mm:ss"
);
LocalDateTime
now
=
LocalDateTime
.
now
();
...
...
src/main/java/emu/grasscutter/utils/Position.java
View file @
b11009f7
...
...
@@ -2,8 +2,10 @@ package emu.grasscutter.utils;
import
java.io.Serializable
;
import
dev.morphia.annotations.Entity
;
import
emu.grasscutter.net.proto.VectorOuterClass.Vector
;
@Entity
public
class
Position
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2001232313615923575L
;
...
...
start.cmd
View file @
b11009f7
...
...
@@ -74,7 +74,9 @@ for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVe
@rem TODO: External proxy when ORIG_PROXY_ENABLE == 0x1
echo
set
ws
=
createobject
(
"wscript.shell"
)
>
"
%temp%
\proxy.vbs"
if
not
"
%MITMDUMP_PATH%
"
==
""
(
echo
ws
.currentdirectory
=
"
%MITMDUMP_PATH%
"
>>
"
%temp%
\proxy.vbs"
)
echo
ws
.run
"cmd /c mitmdump.exe -s "
^&
chr
(
34
)
^&
"
%PROXY_SCRIPT_NAME%
"
^&
chr
(
34
)
^&
" -k"
,
0
>>
"
%temp%
\proxy.vbs"
"
%temp%
\proxy.vbs"
del
/f /q
"
%temp%
\proxy.vbs"
>
nul
2
>
nul
...
...
@@ -117,7 +119,9 @@ set DATABASE=true
mkdir
"
%DATABASE_STORAGE_PATH%
"
>
nul
2
>
nul
echo
set
ws
=
createobject
(
"wscript.shell"
)
>
"
%temp%
\db.vbs"
if
not
"
%MONGODB_PATH%
"
==
""
(
echo
ws
.currentdirectory
=
"
%MONGODB_PATH%
"
>>
"
%temp%
\db.vbs"
)
echo
ws
.run
"cmd /c mongod.exe --dbpath "
^&
chr
(
34
)
^&
"
%DATABASE_STORAGE_PATH%
"
^&
chr
(
34
)
^&
""
,
0
>>
"
%temp%
\db.vbs"
"
%temp%
\db.vbs"
del
/f /q
"
%temp%
\db.vbs"
>
nul
2
>
nul
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment