gpt4 book ai didi

java - 如何获取从单个 IP 登录的所有 UUID(MySQL 数据库 [Minecraft])

转载 作者:行者123 更新时间:2023-11-29 10:05:34 24 4
gpt4 key购买 nike

我只需要最后一 block 拼图来完成我的插件。目前,我遇到了如何为登录到服务器的所有 alt 帐户设置 MySQL 表的问题。我知道我要么需要一个超高的设置数字并将 uuid 添加到下一个空单元格,要么只为每个 uuid 添加一个新列,但我只需要知道将所有 UUID 添加到的最有效方法单个 IP(主键)。看起来我现在很喜欢:

 IP |  
Row #1
Row #2

等等

最佳答案

不要使用 IP 作为主键。事实上,主键是唯一的,并且多次出现具有不同 UUID 的 IP 地址,这使得很难完成您所需要的任务。

尝试这样的事情:

id (PK)| ip_address |   uuid   | date-------------------------------------- 1     |  1.2.3.4   | as-df-gh | 12345 2     |  1.2.3.4   | df-as-gh | 12346 3     |  2.3.4.5   | as-gh-df | 12347 4     |  3.4.5.6   | as-df-gh | 12348 

Whenever someone logs in you can then add another row (or if you don't need the login date column, first check if there's already one with the IP / UUID pair and skip it).

Now you can select all UUIDs from a certain IP address:

SELECT uuid FROM your_table WHERE ip_address = '1.2.3.4'

结果

  uuid--------as-df-ghdf-as-gh

Or the other way around:

SELECT ip_address FROM your_table WHERE uuid = 'as-df-gh'

结果

ip_address---------- 1.2.3.4 3.4.5.6

关于java - 如何获取从单个 IP 登录的所有 UUID(MySQL 数据库 [Minecraft]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51978511/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com