{"id":94,"date":"2024-07-02T02:41:48","date_gmt":"2024-07-01T17:41:48","guid":{"rendered":"https:\/\/hy2t.com\/?p=94"},"modified":"2024-07-04T02:52:25","modified_gmt":"2024-07-03T17:52:25","slug":"agones-%e3%82%b5%e3%82%a4%e3%83%89%e3%82%ab%e3%83%bc%e3%81%a7sdk-client%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hy2t.com\/?p=94","title":{"rendered":"Agones \u30b5\u30a4\u30c9\u30ab\u30fc\u3067SDK Client\u3092\u4f7f\u7528\u3059\u308b"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-1024x1024.png\" alt=\"Agones \u30ed\u30b4\" class=\"wp-image-63\" srcset=\"https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-1024x1024.png 1024w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-300x300.png 300w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-150x150.png 150w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-768x768.png 768w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-1536x1536.png 1536w, https:\/\/hy2t.com\/wp-content\/uploads\/2024\/06\/Full-Color-2048x2048.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30a4\u30c9\u30ab\u30fc\u3092\u4f7f\u3063\u305f\u7d4c\u7def<\/h2>\n\n\n\n<p>Node.js\u306e<a href=\"https:\/\/agones.dev\/site\/docs\/guides\/client-sdks\/nodejs\/\" title=\"Client SDK\">Client SDK<\/a>\u3092\u4f7f\u3063\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3057\u3066\u3069\u3046\u3057\u3066\u3082\u89e3\u6c7a\u3067\u304d\u305a\u3001Go\u306eClient SDK\u3092\u30b5\u30a4\u30c9\u30ab\u30fc\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Websocket\u3092\u4f7f\u3063\u3066\u307f\u305f\u304f\u3001Socket.io\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u9032\u3081\u308b\u3001SDK\u3082\u5165\u308c\u3066\u307f\u308b\u3068\u30d3\u30eb\u30c9\u304c\u5931\u6557\u3059\u308b\u3001\u3001\u3068\u3044\u3046\u72b6\u6cc1\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u5099\u5fd8\u3068\u3057\u3066\u30b3\u30fc\u30c9\u3082\u6b8b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<a href=\"https:\/\/github.com\/shimon1119\/chat_agones\">https:\/\/github.com\/shimon1119\/chat_agones<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30e1\u30a4\u30f3\u30b3\u30f3\u30c6\u30ca<\/h2>\n\n\n\n<p><a href=\"https:\/\/socket.io\/docs\/v4\/tutorial\/introduction\">Socket.io\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/a>\u306b\u5c11\u3057\u624b\u3092\u52a0\u3048\u305f\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u63a5\u7d9a\u78ba\u7387\u6642\u306a\u3069\u306b\u30a4\u30d9\u30f3\u30c8\u767a\u751f\u6642\u3001axios\u3067Go\u306eREST API\u30b5\u30fc\u30d0\u30fc\u306b\u901a\u4fe1\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/shimon1119\/chat_agones\/blob\/main\/sample-chat\/index.ts#L22\">https:\/\/github.com\/shimon1119\/chat_agones\/blob\/main\/sample-chat\/index.ts#L22<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30a4\u30c9\u30ab\u30fc<\/h2>\n\n\n\n<p><a href=\"https:\/\/pkg.go.dev\/github.com\/labstack\/echo\/v4\">Go\u306eEcho<\/a>\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>SDK\u3068\u901a\u4fe1\u3059\u308b\u5185\u5bb9\u3082\u30b7\u30f3\u30d7\u30eb\u306bGameServer\u306eSTATE\u3092\u5909\u66f4\u3059\u308b\u306e\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/shimon1119\/chat_agones\/blob\/main\/sdk-client\/server.go\">https:\/\/github.com\/shimon1119\/chat_agones\/blob\/main\/sdk-client\/server.go<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">YAML<\/h2>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-2c03d9ae1306825abc4e40820f238f18\"><code>apiVersion: agones.dev\/v1\nkind: GameServer\nmetadata:\n  name: sample-chat\nspec:\n  container: sample-chat\n  ports:\n    - name: app-port\n      portPolicy: Dynamic\n      containerPort: 3000\n      protocol: TCP\n  health:\n    disabled: true\n    initialDelaySeconds: 60\n    periodSeconds: 12\n    failureThreshold: 5\n  template:\n    spec:\n      containers:\n        - name: sample-chat\n          image: sample-chat:latest\n          imagePullPolicy: IfNotPresent\n\n        - name: sdk-client\n          image: sdk-client:latest\n          imagePullPolicy: IfNotPresent\n          ports:\n            - containerPort: 80<\/code><\/pre>\n\n\n\n<p>health\u306b\u95a2\u3057\u3066\u3046\u307e\u304f\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001disabled: true\u306b\u8a2d\u5b9a\u3057\u3066\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092disabled: false (\u30c7\u30d5\u30a9\u30eb\u30c8)\u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001GameServer\u304cUnhealthy\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30a4\u30c9\u30ab\u30fc\u3068\u306e\u901a\u4fe1\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u540c\u3058Pod\u3067\u8907\u6570\u306e\u30b3\u30f3\u30c6\u30ca\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u898b\u308b<a href=\"https:\/\/kubernetes.io\/ja\/docs\/concepts\/workloads\/pods\/#pod-networking\">localhost\u306f\u5171\u901a<\/a>\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30d5\u30ed\u30f3\u30c8\u306eWeb\u30a2\u30d7\u30ea\u304b\u3089\u3001localhost\/xxxx\u3092\u53e9\u304f\u3060\u3051\u3067\u826f\u3044\u305f\u3081\u3001\u7279\u5225\u306a\u8a2d\u5b9a\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u884c\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u4e0a\u8ff0\u306egit\u3092clone\u3057\u3066\u3001\u5404\u30bd\u30fc\u30b9\u3092\u30d3\u30eb\u30c9\u3057\u3066\u5b9f\u884c\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/googleforgames\/agones\/blob\/main\/examples\/simple-game-server\/main.go\">simple-gameserver<\/a>\u3092\u305a\u3063\u3068\u53c2\u8003\u306b\u3055\u305b\u3066\u3082\u3089\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>go\u306b\u6163\u308c\u3066\u3044\u306a\u3044\u81ea\u5206\u3060\u3068\u3001\u8aad\u3080\u306e\u304c\u96e3\u3057\u304b\u3063\u305f\u308a\u3057\u307e\u3057\u305f\u304c\u3001\u5c11\u306a\u304f\u3068\u3082STATE\u3092\u89e6\u308b\u3060\u3051\u306a\u3089\u3001\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3068\u7c21\u5358\u306b\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3082\u3089\u3063\u3066\u3044\u3066\u52a9\u304b\u308a\u307e\u3057\u305f\u3002\u975e\u540c\u671f\u51e6\u7406\u306b\u6163\u308c\u308b\u306e\u3082\u4eca\u5f8c\u306e\u81ea\u5206\u306e\u8ab2\u984c\u3067\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30a4\u30c9\u30ab\u30fc\u3092\u4f7f\u3063\u305f\u7d4c\u7def Node.js\u306eClient SDK\u3092\u4f7f\u3063\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3057\u3066\u3069\u3046\u3057\u3066\u3082\u89e3\u6c7a\u3067\u304d\u305a\u3001Go\u306eClient SDK\u3092\u30b5\u30a4\u30c9\u30ab\u30fc\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002 Websocket\u3092\u4f7f\u3063\u3066\u307f\u305f\u304f\u3001S [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":63,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[12],"tags":[8],"class_list":["post-94","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-12","tag-k8s"],"_links":{"self":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/94","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":3,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions\/98"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=\/wp\/v2\/media\/63"}],"wp:attachment":[{"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hy2t.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}